minor improvement

This commit is contained in:
Pilzinsel64
2025-10-31 09:41:41 +01:00
parent 53377485bb
commit d8b89379cc
2 changed files with 7 additions and 4 deletions

View File

@@ -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();
} }

View File

@@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<Version>2.9.1</Version> <Version>2.9.2</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>