This commit is contained in:
@@ -71,7 +71,16 @@ namespace AyaNova.Biz
|
||||
Validate(dbObject);
|
||||
if (HasErrors)
|
||||
return null;
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
try
|
||||
{
|
||||
await ct.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
||||
return null;
|
||||
}
|
||||
//Log modification and save context
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, 1, BizType, AyaEvent.Modified), ct);
|
||||
//Update the static copy for the server
|
||||
|
||||
@@ -74,10 +74,20 @@ namespace AyaNova.Biz
|
||||
Validate(dbObject);
|
||||
if (HasErrors)
|
||||
return null;
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
try
|
||||
{
|
||||
await ct.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
||||
return null;
|
||||
}
|
||||
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, 1, BizType, AyaEvent.Modified), ct);
|
||||
//Update the static copy for the server
|
||||
ServerGlobalOpsSettingsCache.Backup=dbObject;
|
||||
ServerGlobalOpsSettingsCache.Backup = dbObject;
|
||||
return dbObject;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace AyaNova.Models
|
||||
public GlobalOpsBackupSettings()
|
||||
{
|
||||
Id = 1;//always 1
|
||||
BackupTime = new DateTime(2020, 5, 19, 23, 59, 0, DateTimeKind.Utc);//date doesn't matter it only uses hour
|
||||
BackupTime = new DateTime(2020, 5, 19, 23, 59, 0, DateTimeKind.Local).ToUniversalTime();//date doesn't matter it only uses hour
|
||||
LastBackup = DateTime.MinValue;
|
||||
BackupSetsToKeep = 3;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user