-
Notifications
You must be signed in to change notification settings - Fork 14
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
#3666 - Queue Monitoring - Refactoring Schedulers #4032
#3666 - Queue Monitoring - Refactoring Schedulers #4032
Conversation
@@ -49,7 +49,7 @@ export class CancelApplicationAssessmentProcessor extends BaseQueue<CancelAssess | |||
* @param job information to perform the process. | |||
* @param processSummary process summary for logging. | |||
* @returns processing result. */ | |||
async process( | |||
protected async process( |
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.
👍
appLogger: this.logger, | ||
jobLogger: job, | ||
}); | ||
await summary.info("Processing pending applications to be archived."); |
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.
Minor. the info message can be retained.
import { QueueService } from "@sims/services/queue"; | ||
import { QueueNames } from "@sims/utilities"; | ||
import { ConfigService } from "@sims/utilities/config"; | ||
import { InjectLogger } from "@sims/utilities/logger"; | ||
import { InjectLogger, LoggerService } from "@sims/utilities/logger"; |
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.
👍
* To be removed once the method {@link process} is implemented. | ||
* This method "hides" the {@link Process} decorator from the base class. | ||
*/ | ||
async processQueue(): Promise<string | string[]> { |
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.
Can we have the default implementation in the base class itself so that we don't have to repeat in other places? - Is that approach not working?
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.
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.
Great Job! Just left one minor comment.
protected async process( | ||
_job: Job<void>, | ||
processSummary: ProcessSummary, | ||
): Promise<string | string[]> { |
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.
The return can be Promise<string[]>
.
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.
Changed!
this.logger.log( | ||
`Processing CRA integration job ${job.id} of type ${job.name}.`, | ||
); | ||
protected async process( |
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.
Please add processSummary
to comments.
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.
Added!
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.
Great job with the refactoring. Just minor comments.
|
Extended the
BaseScheduler
from theBaseQueue
to enforce all the same basic features likeporcessSummary
and error handling, as agreed during PR #3666 - Queue Monitoring - Default Queue Error Handling #4020.Started the refactor os some scheduler to be used as a baseline for the upcoming refactors.
Added the below code to every scheduler to be refactored.
Note: this is also responsible for the Sonarcloud duplication issue. There are 23 files that have exactly the same change.