Skip to content

Commit

Permalink
fix(scs-jobs): typo about Events
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerald Baulig committed Sep 23, 2024
1 parent 2dc8edf commit 916a34b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/scs-jobs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,14 @@ export const runWorker = async (
const start = Date.now();
const result = await cb(job);
logger.verbose(`job@${filteredJob.name}#${filteredJob.id} completed in ${Date.now() - start}ms`, filteredJob);
let marshalledResult;
let marshalledResult: any;
if (result)
marshalledResult = marshallProtobufAny(result);
await jobEvents.emit('jobDone', {
id: job.id, type: job.name, schedule_type: job.data.schedule_type, result: marshalledResult
id: job.id,
type: job.name,
schedule_type: job.data.schedule_type,
result: marshalledResult
});

return result;
Expand Down Expand Up @@ -188,7 +191,7 @@ export type RunWorkerFunc = typeof runWorker;
export type DefaultExportFunc = (
cfg: ServiceConfig,
logger: Logger,
events: Event,
events: Events,
runWorker: RunWorkerFunc,
) => Promise<void>;
export * from './types.js';

0 comments on commit 916a34b

Please sign in to comment.