minor improvement
This commit is contained in:
@@ -26,9 +26,12 @@ public class JobsHandler(IApiServer server)
|
|||||||
if (server.Jobs.Jobs.FirstOrDefault(n => n.Name == name) is not Job job)
|
if (server.Jobs.Jobs.FirstOrDefault(n => n.Name == name) is not Job job)
|
||||||
return ApiResult.BadRequest();
|
return ApiResult.BadRequest();
|
||||||
|
|
||||||
var now = DateTime.Now;
|
var context = new JobContext(server.Jobs);
|
||||||
job.Execute(new(server.Jobs));
|
job.LastExecution = DateTime.Now;
|
||||||
job.LastExecution = now;
|
job.Execute(context);
|
||||||
|
|
||||||
|
if (context.HasError)
|
||||||
|
return ApiResult.InternalServerError();
|
||||||
|
|
||||||
return ApiResult.Ok();
|
return ApiResult.Ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>2.9.1</Version>
|
<Version>2.9.2</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user