This commit is contained in:
2020-01-27 22:52:21 +00:00
parent dafdaac654
commit 5ee6c90586
4 changed files with 8 additions and 8 deletions

View File

@@ -124,7 +124,7 @@ namespace AyaNova.Api.Controllers
try
{
if (!biz.PutAsync(o, inObj))
if (!await biz.PutAsync(o, inObj))
{
return BadRequest(new ApiErrorResponse(biz.Errors));
}
@@ -189,7 +189,7 @@ namespace AyaNova.Api.Controllers
try
{
//patch and validate
if (!biz.PatchAsync(o, objectPatch, concurrencyToken))
if (!await biz.PatchAsync(o, objectPatch, concurrencyToken))
{
return BadRequest(new ApiErrorResponse(biz.Errors));
}

View File

@@ -298,7 +298,7 @@ namespace AyaNova.Api.Controllers
/// </summary>
/// <returns>Nothing</returns>
[HttpGet("TestWidgetJob")]
public ActionResult TestWidgetJob()
public async Task<IActionResult> TestWidgetJob()
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
@@ -310,7 +310,7 @@ namespace AyaNova.Api.Controllers
OpsJob j = new OpsJob();
j.Name = "TestWidgetJob";
j.JobType = JobType.TestWidgetJob;
JobsBiz.AddJobAsync(j, ct);
await JobsBiz.AddJobAsync(j, ct);
return Accepted(new { JobId = j.GId });//202 accepted
}

View File

@@ -64,7 +64,7 @@ namespace AyaNova.Biz
//Get a count of important tables in db
List<string> allTableNames = DbUtil.GetAllTablenamesAsync();
List<string> allTableNames = await DbUtil.GetAllTablenamesAsync();
//Skip some tables as they are internal and / or only ever have one record
List<string> skipTableNames = new List<string>();
@@ -76,7 +76,7 @@ namespace AyaNova.Biz
if (!skipTableNames.Contains(table))
{
var tags = new MetricTags("TableTagKey", table);
metrics.Measure.Gauge.SetValue(MetricsRegistry.DBRecordsGauge, tags, DbUtil.CountOfRecordsAsync(table));
metrics.Measure.Gauge.SetValue(MetricsRegistry.DBRecordsGauge, tags, await DbUtil.CountOfRecordsAsync(table));
}
}
}

View File

@@ -111,9 +111,9 @@ namespace AyaNova.Biz
foreach (OpsJob j in jobs)
{
//OPSMETRIC
JobsBiz.LogJobAsync(j.GId, "Job took too long to run - setting to failed", ct);
await JobsBiz.LogJobAsync(j.GId, "Job took too long to run - setting to failed", ct);
log.LogError($"Job found job stuck in running status and set to failed: deadline={dtRunningDeadline.ToString()}, jobId={j.GId.ToString()}, jobname={j.Name}, jobtype={j.JobType.ToString()}, jobObjectType={j.ObjectType.ToString()}, jobObjectId={j.ObjectId.ToString()}");
JobsBiz.UpdateJobStatusAsync(j.GId, JobStatus.Failed, ct);
await JobsBiz.UpdateJobStatusAsync(j.GId, JobStatus.Failed, ct);
}
}