added sum, reset cron

This commit is contained in:
John Yeo
2025-01-24 15:29:50 +00:00
parent 8c9df1e0b9
commit c2afc4deec
22 changed files with 423 additions and 8482 deletions

View File

@@ -45,13 +45,7 @@ const initWorker = (id: number, queue: Queue) => {
let worker = new Worker(
"autumn",
async (job: Job) => {
// if (job.name === "update-balance") {
// await runUpdateBalanceTask(job.data);
// }
const { customerId, customer } = job.data;
// await runUpdateBalanceTask(job.data);
// return;
const { customerId } = job.data;
while (!(await acquireLock(customerId, 10000))) {
// console.log(`Customer ${customer.id} locked by another worker`);