Added some additional logging to the metadata refresh

This commit is contained in:
tidusjar 2020-06-19 23:50:22 +01:00
parent a7f747cf46
commit 87b94e3ed0
11 changed files with 10 additions and 22 deletions

View file

@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Quartz; using Quartz;
using Quartz.Impl; using Quartz.Impl;
using Quartz.Impl.Matchers;
using Quartz.Spi; using Quartz.Spi;
namespace Ombi.Helpers namespace Ombi.Helpers

View file

@ -66,11 +66,13 @@ namespace Ombi.Schedule.Jobs.Emby
public async Task Execute(IJobExecutionContext job) public async Task Execute(IJobExecutionContext job)
{ {
_log.LogInformation("Starting Emby Availability Check");
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds) await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
.SendAsync(NotificationHub.NotificationEvent, "Emby Availability Checker Started"); .SendAsync(NotificationHub.NotificationEvent, "Emby Availability Checker Started");
await ProcessMovies(); await ProcessMovies();
await ProcessTv(); await ProcessTv();
_log.LogInformation("Finished Emby Availability Check");
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds) await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
.SendAsync(NotificationHub.NotificationEvent, "Emby Availability Checker Finished"); .SendAsync(NotificationHub.NotificationEvent, "Emby Availability Checker Finished");
} }

View file

@ -78,6 +78,7 @@ namespace Ombi.Schedule.Jobs.Emby
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds) await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
.SendAsync(NotificationHub.NotificationEvent, "Emby Episode Sync Finished"); .SendAsync(NotificationHub.NotificationEvent, "Emby Episode Sync Finished");
_logger.LogInformation("Emby Episode Sync Finished - Triggering Metadata refresh");
await OmbiQuartz.TriggerJob(nameof(IRefreshMetadata), "System"); await OmbiQuartz.TriggerJob(nameof(IRefreshMetadata), "System");
} }

View file

@ -69,19 +69,19 @@ namespace Ombi.Schedule.Jobs.Ombi
if (embySettings.Enable) if (embySettings.Enable)
{ {
await StartEmby(embySettings); await StartEmby(embySettings);
await OmbiQuartz.TriggerJob(nameof(IEmbyAvaliabilityChecker), "Emby");
await OmbiQuartz.TriggerJob(nameof(IEmbyAvaliabilityChecker), "Emby");
} }
} }
catch (Exception e) catch (Exception e)
{ {
_log.LogError(e, "Exception when refreshing the Plex Metadata"); _log.LogError(e, $"Exception when refreshing the Metadata Refresh");
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds) await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
.SendAsync(NotificationHub.NotificationEvent, "Metadata Refresh Failed"); .SendAsync(NotificationHub.NotificationEvent, "Metadata Refresh Failed");
throw; return;
} }
_log.LogInformation("Metadata refresh finished");
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds) await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
.SendAsync(NotificationHub.NotificationEvent, "Metadata Refresh Finished"); .SendAsync(NotificationHub.NotificationEvent, "Metadata Refresh Finished");
} }

View file

@ -63,7 +63,8 @@ namespace Ombi.Schedule.Jobs.Plex
_log.LogError(LoggingEvents.Cacher, e, "Caching Episodes Failed"); _log.LogError(LoggingEvents.Cacher, e, "Caching Episodes Failed");
} }
_log.LogInformation("Plex Episode Sync Finished - Triggering Metadata refresh");
await OmbiQuartz.TriggerJob(nameof(IRefreshMetadata), "System"); await OmbiQuartz.TriggerJob(nameof(IRefreshMetadata), "System");
await _notification.Clients.Clients(NotificationHub.AdminConnectionIds) await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)

View file

@ -11,7 +11,6 @@
public string AutomaticUpdater { get; set; } public string AutomaticUpdater { get; set; }
public string UserImporter { get; set; } public string UserImporter { get; set; }
public string SickRageSync { get; set; } public string SickRageSync { get; set; }
public string RefreshMetadata { get; set; }
public string Newsletter { get; set; } public string Newsletter { get; set; }
public string LidarrArtistSync { get; set; } public string LidarrArtistSync { get; set; }
public string IssuesPurge { get; set; } public string IssuesPurge { get; set; }

View file

@ -56,11 +56,6 @@ namespace Ombi.Settings.Settings.Models
return ValidateCron(Get(s.SickRageSync, Cron.Hourly(35))); return ValidateCron(Get(s.SickRageSync, Cron.Hourly(35)));
} }
public static string RefreshMetadata(JobSettings s)
{
return ValidateCron(Get(s.RefreshMetadata, Cron.DayInterval(3)));
}
public static string LidarrArtistSync(JobSettings s) public static string LidarrArtistSync(JobSettings s)
{ {
return ValidateCron(Get(s.LidarrArtistSync, Cron.Hourly(40))); return ValidateCron(Get(s.LidarrArtistSync, Cron.Hourly(40)));

View file

@ -140,7 +140,6 @@ export interface IJobSettings {
automaticUpdater: string; automaticUpdater: string;
userImporter: string; userImporter: string;
sickRageSync: string; sickRageSync: string;
refreshMetadata: string;
newsletter: string; newsletter: string;
plexRecentlyAddedSync: string; plexRecentlyAddedSync: string;
lidarrArtistSync: string; lidarrArtistSync: string;

View file

@ -84,14 +84,6 @@
<small *ngIf="form.get('userImporter').hasError('required')" class="error-text">The User Importer is required</small> <small *ngIf="form.get('userImporter').hasError('required')" class="error-text">The User Importer is required</small>
<button type="button" class="btn btn-sm btn-primary-outline" (click)="testCron(form.get('userImporter')?.value)">Test</button> <button type="button" class="btn btn-sm btn-primary-outline" (click)="testCron(form.get('userImporter')?.value)">Test</button>
</div> </div>
<div class="form-group">
<label for="userImporter" class="control-label">Refresh Metadata</label>
<input type="text" class="form-control form-control-custom" [ngClass]="{'form-error': form.get('refreshMetadata').hasError('required')}" id="refreshMetadata" name="refreshMetadata" formControlName="refreshMetadata">
<small *ngIf="form.get('refreshMetadata').hasError('required')" class="error-text">The Refresh Metadata is required</small>
<button type="button" class="btn btn-sm btn-primary-outline" (click)="testCron(form.get('refreshMetadata')?.value)">Test</button>
</div>
<div class="form-group"> <div class="form-group">
<label for="userImporter" class="control-label">Newsletter</label> <label for="userImporter" class="control-label">Newsletter</label>

View file

@ -28,7 +28,6 @@ export class JobsComponent implements OnInit {
sonarrSync: [x.sonarrSync, Validators.required], sonarrSync: [x.sonarrSync, Validators.required],
radarrSync: [x.radarrSync, Validators.required], radarrSync: [x.radarrSync, Validators.required],
sickRageSync: [x.sickRageSync, Validators.required], sickRageSync: [x.sickRageSync, Validators.required],
refreshMetadata: [x.refreshMetadata, Validators.required],
newsletter: [x.newsletter, Validators.required], newsletter: [x.newsletter, Validators.required],
plexRecentlyAddedSync: [x.plexRecentlyAddedSync, Validators.required], plexRecentlyAddedSync: [x.plexRecentlyAddedSync, Validators.required],
lidarrArtistSync: [x.lidarrArtistSync, Validators.required], lidarrArtistSync: [x.lidarrArtistSync, Validators.required],

View file

@ -569,7 +569,6 @@ namespace Ombi.Controllers.V1
j.PlexContentSync = j.PlexContentSync.HasValue() ? j.PlexContentSync : JobSettingsHelper.PlexContent(j); j.PlexContentSync = j.PlexContentSync.HasValue() ? j.PlexContentSync : JobSettingsHelper.PlexContent(j);
j.UserImporter = j.UserImporter.HasValue() ? j.UserImporter : JobSettingsHelper.UserImporter(j); j.UserImporter = j.UserImporter.HasValue() ? j.UserImporter : JobSettingsHelper.UserImporter(j);
j.SickRageSync = j.SickRageSync.HasValue() ? j.SickRageSync : JobSettingsHelper.SickRageSync(j); j.SickRageSync = j.SickRageSync.HasValue() ? j.SickRageSync : JobSettingsHelper.SickRageSync(j);
j.RefreshMetadata = j.RefreshMetadata.HasValue() ? j.RefreshMetadata : JobSettingsHelper.RefreshMetadata(j);
j.PlexRecentlyAddedSync = j.PlexRecentlyAddedSync.HasValue() ? j.PlexRecentlyAddedSync : JobSettingsHelper.PlexRecentlyAdded(j); j.PlexRecentlyAddedSync = j.PlexRecentlyAddedSync.HasValue() ? j.PlexRecentlyAddedSync : JobSettingsHelper.PlexRecentlyAdded(j);
j.Newsletter = j.Newsletter.HasValue() ? j.Newsletter : JobSettingsHelper.Newsletter(j); j.Newsletter = j.Newsletter.HasValue() ? j.Newsletter : JobSettingsHelper.Newsletter(j);
j.LidarrArtistSync = j.LidarrArtistSync.HasValue() ? j.LidarrArtistSync : JobSettingsHelper.LidarrArtistSync(j); j.LidarrArtistSync = j.LidarrArtistSync.HasValue() ? j.LidarrArtistSync : JobSettingsHelper.LidarrArtistSync(j);