Exemplo n.º 1
0
 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);
         }
     }
 }
Exemplo n.º 2
0
 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));
     }
 }
Exemplo n.º 3
0
        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));
            }
        }
Exemplo n.º 4
0
        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));
            }
        }