Skip to content

Commit

Permalink
Unregister
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Mar 8, 2024
1 parent 8a49b57 commit e18b5c9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/jobs/src/transactions/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ client.defineJob({
.eq("team_id", teamId)
.eq("enabled", true);

if (!accountsData?.length) {
// NOTE: Remove all old schedulers
const event = await scheduler.unregister(ctx.source.id);
await io.logger.debug("Unregister", event);
}

await io.logger.debug("Accounts", JSON.stringify(accountsData, null, 2));

if (error) {
await io.logger.error("Accounts Error", error);
// TODO: Remove
const event = await scheduler.unregister(ctx.source.id);

await io.logger.debug("Unregister", event);
}

const promises = accountsData?.map(async (account) => {
Expand Down

0 comments on commit e18b5c9

Please sign in to comment.