Task #215480: [BE] Add org_id in Camp and update using group_users member_type and status active using user_id Task #215497 [BE] Add org_id in program_beneficaires and update org_id using facilitator_id by joining program_facilitator. user_id#904
Task #215480: [BE] Add org_id in Camp and update using group_users member_type and status active using user_id Task #215497 [BE] Add org_id in program_beneficaires and update org_id using facilitator_id by joining program_facilitator. user_id#904sagarkoshti1990 wants to merge 2 commits intotekdi:release-2.8.4from
Conversation
WalkthroughThe recent changes involve modifying the scheduling of various cron jobs in a NestJS application, specifically by commenting out cron schedule annotations in several files. Additionally, a new Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
|
There was a problem hiding this comment.
Review Status
Actionable comments generated: 8
Configuration used: .coderabbit.yaml
Files selected for processing (8)
- src/src/cron/campEnd.cron.ts (1 hunks)
- src/src/cron/cron.module.ts (2 hunks)
- src/src/cron/faAttendanceProcessing.cron.ts (1 hunks)
- src/src/cron/faFaceIndexing.cron.ts (1 hunks)
- src/src/cron/faUserIndexing.cron.ts (1 hunks)
- src/src/cron/housekeeping.cron.ts (1 hunks)
- src/src/cron/prepareCertificateHtml.cron.ts (1 hunks)
- src/src/services/hasura/hasura.service.ts (1 hunks)
Additional comments: 10
src/src/cron/cron.module.ts (2)
- 12-12: The import of
HousekeepingCronis correctly added following NestJS conventions and is consistent with the structure of the module.- 25-25: The addition of
HousekeepingCronto the providers array is correctly implemented, ensuring that it is available for dependency injection throughout the module.src/src/cron/campEnd.cron.ts (1)
- 11-11: The cron schedule annotation for
updateEndCamphas been commented out, effectively disabling the scheduled execution. Please verify that this change is intentional and consider adding a comment to document the reason for this temporary disablement.src/src/cron/faUserIndexing.cron.ts (1)
- 22-22: The cron schedule annotation for
createCollectionUsershas been commented out, disabling its scheduled execution. Please confirm this change was made intentionally and document the reason for this temporary disablement to maintain clarity.src/src/cron/housekeeping.cron.ts (1)
- 10-10: The cron schedule annotations for
updateCampandupdateLeanermethods are commented out, indicating these jobs are not currently scheduled. Please confirm this is intentional and document the reasoning.src/src/cron/faAttendanceProcessing.cron.ts (1)
- 22-22: The cron schedule annotation for
markAttendanceCronhas been commented out, disabling its scheduled execution. Please ensure this change is intentional and document the reason for this temporary disablement to maintain clarity.src/src/services/hasura/hasura.service.ts (2)
- 116-118: The integration of
handleResponseExceptionin thecatchblock ofexecuteRawSqlmethod is a good practice for centralized error handling, enhancing the service's robustness.- 121-127: The addition of
handleResponseExceptionmethod is a commendable improvement for managing exceptions more effectively by extracting and returning relevant error information.src/src/cron/prepareCertificateHtml.cron.ts (1)
- 26-26: The
@Crondecorator usage forprepareCertificateHtmlhas been commented out, disabling its scheduled execution. Please confirm this change was made intentionally and document the reason for this temporary disablement to maintain clarity.src/src/cron/faFaceIndexing.cron.ts (1)
- 22-22: The cron schedule annotation for
indexRekognitionUsershas been commented out. This change will prevent the method from being executed as a scheduled task. If this is intentional, ensure that the method's scheduling is managed elsewhere or document the reason for this change to avoid confusion.
|
|
||
| // Cronjob runs every day at 12am | ||
| @Cron('0 00 * * * ') | ||
| // @Cron('0 00 * * * ') |
There was a problem hiding this comment.
in this and in other crons
|
|
||
| // Cronjob runs every day at 12am | ||
| // @Cron('0/1 * * * *') | ||
| async updateCamp() { |
| } | ||
|
|
||
| // @Cron('0/1 * * * *') | ||
| async updateLeaner() { |
There was a problem hiding this comment.
give this better name
| column_name: 'org_id', | ||
| }); | ||
| console.log(column_create_or_exists); | ||
| if (column_create_or_exists?.exist) { |
There was a problem hiding this comment.
see if we can use transaction start end?
| AND sub.academic_year_id = pf.academic_year_id | ||
| WHERE g.id = sub.id;`; | ||
|
|
||
| const result1 = await this.hasuraService.executeRawSql(updateQuery); |
There was a problem hiding this comment.
use try catch, push to Sentry in case of failure
| table_name: 'program_beneficiaries', | ||
| column_name: 'org_id', | ||
| }); | ||
| if (column_create_or_exists?.exist) { |
There was a problem hiding this comment.
use try catch, push to Sentry in case of failure
| column_name: 'org_id', | ||
| }); | ||
| if (column_create_or_exists?.exist) { | ||
| const updateQuery = `UPDATE program_beneficiaries AS pb |
There was a problem hiding this comment.
see if we can use transaction start, end?
|
|
||
| //cron issue certificate run every 5 minutes | ||
| @Cron(CronExpression.EVERY_5_MINUTES) | ||
| // @Cron(CronExpression.EVERY_5_MINUTES) |
|
|
||
| //first cron runs for each hour's 5th minute eg: 10:05am, 11::05am | ||
| @Cron('05 * * * *') | ||
| // @Cron('05 * * * *') |
|
|
||
| //2nd cron runs for each hour's 15th minute eg: 10:15am, 11::15am | ||
| @Cron('15 * * * *') | ||
| // @Cron('15 * * * *') |
|
|
||
| //3rd cron runs for each hour's 25th minute eg: 10:25am, 11::25am | ||
| @Cron('25 * * * *') | ||
| // @Cron('25 * * * *') |




https://tracker.tekdi.net/issues/215480
https://tracker.tekdi.net/issues/215497
I have ensured that following
Pull Request Checklistis taken care of before sending this PRSummary by CodeRabbit