-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
base: release-2.8.4
Are you sure you want to change the base?
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
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 (
|
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
HousekeepingCron
is correctly added following NestJS conventions and is consistent with the structure of the module.- 25-25: The addition of
HousekeepingCron
to 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
updateEndCamp
has 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
createCollectionUsers
has 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
updateCamp
andupdateLeaner
methods 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
markAttendanceCron
has 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
handleResponseException
in thecatch
block ofexecuteRawSql
method is a good practice for centralized error handling, enhancing the service's robustness.- 121-127: The addition of
handleResponseException
method 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
@Cron
decorator usage forprepareCertificateHtml
has 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
indexRekognitionUsers
has 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.
@@ -8,7 +8,7 @@ export class CampEndCron { | |||
constructor(private hasuraService: HasuraService) {} | |||
|
|||
// Cronjob runs every day at 12am | |||
@Cron('0 00 * * * ') | |||
// @Cron('0 00 * * * ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this and in other crons
|
||
// Cronjob runs every day at 12am | ||
// @Cron('0/1 * * * *') | ||
async updateCamp() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
give it better name
} | ||
|
||
// @Cron('0/1 * * * *') | ||
async updateLeaner() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see if we can use transaction start, end?
@@ -23,7 +23,7 @@ export class PrepareCertificateHtmlCron { | |||
) {} | |||
|
|||
//cron issue certificate run every 5 minutes | |||
@Cron(CronExpression.EVERY_5_MINUTES) | |||
// @Cron(CronExpression.EVERY_5_MINUTES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo
@@ -19,7 +19,7 @@ export class FaUserIndexingCron { | |||
} | |||
|
|||
//first cron runs for each hour's 5th minute eg: 10:05am, 11::05am | |||
@Cron('05 * * * *') | |||
// @Cron('05 * * * *') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo
@@ -19,7 +19,7 @@ export class FaFaceIndexingCron { | |||
} | |||
|
|||
//2nd cron runs for each hour's 15th minute eg: 10:15am, 11::15am | |||
@Cron('15 * * * *') | |||
// @Cron('15 * * * *') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo
@@ -19,7 +19,7 @@ export class FaAttendanceProcessingCron { | |||
} | |||
|
|||
//3rd cron runs for each hour's 25th minute eg: 10:25am, 11::25am | |||
@Cron('25 * * * *') | |||
// @Cron('25 * * * *') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo
https://tracker.tekdi.net/issues/215480
https://tracker.tekdi.net/issues/215497
I have ensured that following
Pull Request Checklist
is taken care of before sending this PRSummary by CodeRabbit