Change events args
This commit is contained in:
@ -91,13 +91,13 @@ namespace Hcs.WebApp.Services
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SetOperationStartedAsync(int operationId)
|
||||
public async Task SetOperationStartedAsync(int operationId, DateTime startedAt)
|
||||
{
|
||||
using var context = GetNewContext();
|
||||
var operation = await context.Operations.FirstOrDefaultAsync(x => x.Id == operationId);
|
||||
if (operation != null)
|
||||
{
|
||||
operation.StartedAt = DateTime.UtcNow;
|
||||
operation.StartedAt = startedAt;
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
@ -133,24 +133,24 @@ namespace Hcs.WebApp.Services
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SetOperationEndedAsync(HcsDbContext context, int operationId)
|
||||
public async Task SetOperationEndedAsync(HcsDbContext context, int operationId, DateTime endedAt)
|
||||
{
|
||||
var operation = await context.Operations.FirstOrDefaultAsync(x => x.Id == operationId);
|
||||
if (operation != null)
|
||||
{
|
||||
operation.EndedAt = DateTime.UtcNow;
|
||||
operation.EndedAt = endedAt;
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SetOperationEndedWithFailAsync(int operationId, string failureReason)
|
||||
public async Task SetOperationEndedWithFailAsync(int operationId, DateTime endedAt, string failureReason)
|
||||
{
|
||||
using var context = GetNewContext();
|
||||
var operation = await context.Operations.FirstOrDefaultAsync(x => x.Id == operationId);
|
||||
if (operation != null)
|
||||
{
|
||||
operation.EndedAt = DateTime.UtcNow;
|
||||
operation.EndedAt = endedAt;
|
||||
operation.FailureReason = failureReason;
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
|
||||
Reference in New Issue
Block a user