Browse Source

Added some more logs for backup handling.

pull/926/head
Sebastian 4 years ago
parent
commit
fb29b183cb
  1. 4
      backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetsBulkUpdateCommandMiddleware.cs
  2. 11
      backend/src/Squidex.Domain.Apps.Entities/Backup/BackupProcessor.cs

4
backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetsBulkUpdateCommandMiddleware.cs

@ -139,7 +139,7 @@ namespace Squidex.Domain.Apps.Entities.Assets.DomainObject
}
catch (Exception ex)
{
log.LogError(ex, "Faield to execute asset bulk job with index {index} of type {type}.",
log.LogError(ex, "Failed to execute asset bulk job with index {index} of type {type}.",
task.JobIndex,
task.CommandJob.Type);
@ -161,7 +161,7 @@ namespace Squidex.Domain.Apps.Entities.Assets.DomainObject
}
catch (Exception ex)
{
log.LogError(ex, "Faield to execute asset bulk job with index {index} of type {type}.",
log.LogError(ex, "Failed to execute asset bulk job with index {index} of type {type}.",
task.JobIndex,
task.CommandJob.Type);

11
backend/src/Squidex.Domain.Apps.Entities/Backup/BackupProcessor.cs

@ -67,6 +67,9 @@ namespace Squidex.Domain.Apps.Entities.Backup
if (state.Value.Jobs.RemoveAll(x => x.Stopped == null) > 0)
{
// This should actually never happen, so we log with warning.
log.LogWarning("Removed unfinished backups for app {appId} after start.", appId);
await state.WriteAsync(ct);
}
}
@ -75,6 +78,8 @@ namespace Squidex.Domain.Apps.Entities.Backup
{
return scheduler.ScheduleAsync(async _ =>
{
log.LogInformation("Clearing backups for app {appId}.", appId);
foreach (var backup in state.Value.Jobs)
{
await backupArchiveStore.DeleteAsync(backup.Id, default);
@ -109,6 +114,8 @@ namespace Squidex.Domain.Apps.Entities.Backup
Handlers = backupHandlerFactory.CreateMany()
};
log.LogInformation("Starting new backup with backup id '{backupId}'.", run.Job.Id);
state.Value.Jobs.Insert(0, run.Job);
try
{
@ -192,7 +199,7 @@ namespace Squidex.Domain.Apps.Entities.Backup
{
await SetStatusAsync(run, JobStatus.Failed);
log.LogError(ex, "Faield to make backup with backup id '{backupId}'.", run.Job.Id);
log.LogError(ex, "Failed to make backup with backup id '{backupId}'.", run.Job.Id);
}
}
@ -212,6 +219,8 @@ namespace Squidex.Domain.Apps.Entities.Backup
throw new DomainObjectNotFoundException(id.ToString());
}
log.LogInformation("Deleting backup with backup id '{backupId}' for app {appId}.", job.Id, appId);
if (currentRun?.Job == job)
{
currentRun.Cancel();

Loading…
Cancel
Save