public void StartScheduledBackup(BackupSchedule schedule) { lock (SynchRoot) { var item = ProgressQueue.GetTasks <BackupProgressItem>().FirstOrDefault(t => t.TenantId == schedule.TenantId); if (item != null && item.IsCompleted) { ProgressQueue.RemoveTask(item.Id); item = null; } if (item == null) { item = FactoryProgressItem.CreateBackupProgressItem(schedule, false, TempFolder, Limit, CurrentRegion, ConfigPaths); ProgressQueue.QueueTask(item); } } }
public BackupProgress StartRestore(StartRestoreRequest request) { lock (SynchRoot) { var item = ProgressQueue.GetTasks <RestoreProgressItem>().FirstOrDefault(t => t.TenantId == request.TenantId); if (item != null && item.IsCompleted) { ProgressQueue.RemoveTask(item.Id); item = null; } if (item == null) { item = FactoryProgressItem.CreateRestoreProgressItem(request, TempFolder, UpgradesPath, CurrentRegion, ConfigPaths); ProgressQueue.QueueTask(item); } return(ToBackupProgress(item)); } }
public BackupProgress StartTransfer(int tenantId, string targetRegion, bool transferMail, bool notify) { lock (SynchRoot) { var item = ProgressQueue.GetTasks <TransferProgressItem>().FirstOrDefault(t => t.TenantId == tenantId); if (item != null && item.IsCompleted) { ProgressQueue.RemoveTask(item.Id); item = null; } if (item == null) { item = FactoryProgressItem.CreateTransferProgressItem(targetRegion, transferMail, tenantId, TempFolder, Limit, notify, CurrentRegion, ConfigPaths); ProgressQueue.QueueTask(item); } return(ToBackupProgress(item)); } }
public BackupProgress StartBackup(StartBackupRequest request) { lock (SynchRoot) { var item = ProgressQueue.GetTasks <BackupProgressItem>().FirstOrDefault(t => t.TenantId == request.TenantId); if (item != null && item.IsCompleted) { ProgressQueue.RemoveTask(item.Id); item = null; } if (item == null) { item = FactoryProgressItem.CreateBackupProgressItem(request, false, TempFolder, Limit, CurrentRegion, ConfigPaths); ProgressQueue.QueueTask(item); } item.PublishChanges(); return(ToBackupProgress(item)); } }