Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

post JobCreated when job is created #2677

Merged
merged 3 commits into from
Dec 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/ApiService/ApiService/Functions/Jobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,16 @@ private async Task<HttpResponseData> Post(HttpRequestData req) {
var r = await _context.JobOperations.Insert(job);
if (!r.IsOk) {
_logTracer.WithTag("HttpRequest", "POST").WithHttpStatus(r.ErrorV).Error($"failed to insert job {job.JobId:Tag:JobId}");
stishkin marked this conversation as resolved.
Show resolved Hide resolved
return await _context.RequestHandling.NotOk(
req,
new Error(
stishkin marked this conversation as resolved.
Show resolved Hide resolved
Code: ErrorCode.UNABLE_TO_CREATE,
Errors: new string[] { "unable to create job " }
),
"job");
}
await _context.Events.SendEvent(new EventJobCreated(job.JobId, job.Config, job.UserInfo));
stishkin marked this conversation as resolved.
Show resolved Hide resolved

return await RequestHandling.Ok(req, JobResponse.ForJob(job));
}

Expand Down