Skip to content

Commit

Permalink
todo comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheraff committed Jul 11, 2024
1 parent 1eb469c commit 7c2fd8b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ function makeExecutionContext(registrationContext: RegistrationContext, task: Ta
const source = entry ? null : internals?.source ?? `Job.run("${options.id}", ${fn.toString()})`

const onSuccess = (data: Data) => {
// TODO: use logger instead of storage for this event
registrationContext.recordEvent(`step/${task.job}/${step}/success`, task.input, JSON.stringify({ data, runs }))
return syncOrPromise<void>(resolve => {
registrationContext.recordStep(
Expand All @@ -578,6 +579,7 @@ function makeExecutionContext(registrationContext: RegistrationContext, task: Ta
if (typeof retry === 'number') canRetry = runs < retry
else canRetry = retry(runs, error)
}
// TODO: use logger instead of storage for this event
registrationContext.recordEvent(`step/${task.job}/${step}/error`, task.input, JSON.stringify({ error: serializeError(error), runs }))
return syncOrPromise<void>(resolve => {
if (!canRetry) {
Expand Down Expand Up @@ -624,6 +626,7 @@ function makeExecutionContext(registrationContext: RegistrationContext, task: Ta
])
: maybePromise

// TODO: use logger instead of storage for this event
registrationContext.recordEvent(`step/${task.job}/${step}/run`, task.input, JSON.stringify({ runs }))
promises.push(new Promise<Data>(resolve =>
registrationContext.recordStep(
Expand Down

0 comments on commit 7c2fd8b

Please sign in to comment.