feat: add cron job for allowance and implement cron lock

This commit is contained in:
Abdalhamid Alhamad
2024-12-30 16:10:19 +03:00
parent 0fd2066c4a
commit c0fafd3f7c
13 changed files with 202 additions and 3 deletions

View File

@ -89,6 +89,13 @@ export class AllowancesService {
return allowance;
}
async findAllowancesChunks(chunkSize: number) {
this.logger.log(`Finding allowances chunks`);
const allowances = await this.allowancesRepository.findAllowancesChunks(chunkSize);
this.logger.log(`Returning allowances chunks`);
return allowances;
}
private async prepareAllowanceDocuments(allowance: Allowance[]) {
this.logger.log(`Preparing document for allowances`);
await Promise.all(