-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gerald Baulig
committed
Sep 23, 2024
1 parent
dadb7af
commit 285b8ae
Showing
6 changed files
with
46 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
import { deleteUsersWithExpiredActivation } from './implementation/delete_users_with_expired_activation_job.js'; | ||
import { | ||
type DefaultExportFunc | ||
} from '@restorecommerce/scs-jobs'; | ||
import { | ||
deleteUsersWithExpiredActivation | ||
} from './implementation/delete_users_with_expired_activation_job.js'; | ||
const DELETE_USERS_WITH_EXPIRED_ACTIVATION = 'delete-users-with-expired-activation-job'; | ||
|
||
export default async (cfg, logger, events, runWorker) => { | ||
await runWorker('identity-srv-queue', 1, cfg, logger, events, async (job) => { | ||
if (job.type === DELETE_USERS_WITH_EXPIRED_ACTIVATION) { | ||
await deleteUsersWithExpiredActivation(cfg, logger); | ||
const main: DefaultExportFunc = async (cfg, logger, events: any, runWorker) => { | ||
await runWorker( | ||
'identity-srv-queue', 1, cfg, logger, events, | ||
async (job: any) => { | ||
const name = job.type ?? job.name; | ||
if (name === DELETE_USERS_WITH_EXPIRED_ACTIVATION) { | ||
await deleteUsersWithExpiredActivation(cfg, logger); | ||
} | ||
} | ||
}); | ||
); | ||
}; | ||
|
||
export default main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters