-
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
#3667 - Bull Scheduler Increments the Next Scheduled Job When Manually Promoted #3957
Conversation
sources/packages/backend/libs/services/src/constants/system-configurations-constants.ts
Outdated
Show resolved
Hide resolved
@@ -25,6 +30,12 @@ import { DatabaseModule } from "@sims/sims-db"; | |||
inject: [ConfigService], | |||
}), | |||
BullModule.registerQueueAsync(...getQueueModules()), | |||
BullBoardModule.forRootAsync({ |
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.
As discussed, the queue module is shared with API (to publish messages to queue) and loading bull board module here will stand up the bull dashboard in SIMS API as well.
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 modules are now added only to the queue-consumers.
* @returns Bull Board module options with the dashboard route, | ||
* authentication middleware and the board options. | ||
*/ | ||
async function bullBoardModuleFactory(configService: ConfigService) { |
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 specify the return type in the method.
async function bullBoardModuleFactory(
configService: ConfigService,
): Promise<BullBoardModuleOptions>
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.
Return type added.
/** | ||
* Adds all queues to the bull board during application initialization. | ||
* checking if the queue is active and if it is a scheduler. | ||
*/ |
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 please check the comment and period.
Also please add returns.
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.
Add the period.
About the return type, I do not believe that we usually add comments for Promise void. Please let me know if that is what you meant.
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.
You are right about the return type.
boardLogo: { | ||
path: "https://sims.studentaidbc.ca/favicon-32x32.png", | ||
}, | ||
favIcon: { | ||
default: "https://sims.studentaidbc.ca/favicon-16x16.png", | ||
alternative: "https://sims.studentaidbc.ca/favicon-32x32.png", |
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.
❤️Looks great with SIMS logo.
Great Job! Please have a look at the comments. Except one rest all are minor. |
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.
LGTM, nice work @andrewsignori-aot
replace: BullBoardQueuesModule, | ||
by: BullBoardQueuesModuleMock, |
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.
Thanks for doing the changes. Looks good 👍
This reverts commit d986735.
|
Updated Bull Board-related packages to take advantage of the feature present in the newer version that allows a new job to be added (same as duplicate), allowing the schedulers to be executed without affecting their current time to be executed again.
Notes:
queue-consumers
restarted, the delayed job was restored.Using the add/duplicate option
While creating the new job the properties can be edited, for instance, the corn expression can be edited to create a new time to execute the scheduler.
Please note that
timestamp
andprevMillis
should be removed. These properties are generated once the job is created.As mentioned in the source code,
timestamp
is the "Timestamp when the job was created." andprevMillis
is a "Internal property used by repeatable jobs."Refactor
The refactored code is equivalent to the one previously on the
main.ts
.