protected void UpdateBackupStatus(string newMsg, string details, BackupStatus.BackupMessageSeverity severity)
 {
     try
     {
         log.Info(newMsg);
         var backupStatus = GetBackupStatus();
         if (backupStatus == null)
             return;
         backupStatus.Messages.Add(new BackupStatus.BackupMessage
         {
             Message = newMsg,
             Timestamp = SystemTime.UtcNow,
             Severity = severity,
             Details = details
         });
         SetBackupStatus(backupStatus);
     }
     catch (Exception e)
     {
         log.WarnException("Failed to update backup status", e);
     }
 }
Example #2
0
 protected void UpdateBackupStatus(string newMsg, string details, BackupStatus.BackupMessageSeverity severity)
 {
     try
     {
         log.Info(newMsg);
         var jsonDocument = systemDatabase.Documents.Get(BackupStatusDocumentKey, null);
         if (jsonDocument == null)
             return;
         var backupStatus = jsonDocument.DataAsJson.JsonDeserialization<BackupStatus>();
         backupStatus.Messages.Add(new BackupStatus.BackupMessage
         {
             Message = newMsg,
             Timestamp = SystemTime.UtcNow,
             Severity = severity,
             Details = details
         });
         systemDatabase.Documents.Put(BackupStatusDocumentKey, null, RavenJObject.FromObject(backupStatus),
                      jsonDocument.Metadata,
                      null);
     }
     catch (Exception e)
     {
         log.WarnException("Failed to update backup status", e);
     }
 }
 private void SetBackupStatus(BackupStatus backupStatus)
 {
     filesystem.Storage.Batch(accessor => accessor.SetConfig(BackupStatus.RavenBackupStatusDocumentKey, RavenJObject.FromObject(backupStatus)));
 }