bcgov / SIMS

Student Information Management System. Post-Secondary Student Financial Aid System
Apache License 2.0
25 stars 14 forks source link

#3667 - Bull Scheduler Increments the Next Scheduled Job When Manually Promoted #3957

Closed andrewsignori-aot closed 2 days ago

andrewsignori-aot commented 3 days ago

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:

  1. during the local tests, when a delayed job was deleted and the queue-consumers restarted, the delayed job was restored.
  2. this PR is intended to be part of the upcoming release. The research for the ticket will continue.

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 and prevMillis 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." and prevMillis is a "Internal property used by repeatable jobs."

image

{
  "repeat": {
    "count": 1,
    "key": "__default__::::0 7 * * *",
    "cron": "0 7 * * *"
  },
  "jobId": "repeat:2c2720c5e8b4e9ce99993becec27a0ff:1731999600000",
  "delay": 42485905,
  "timestamp": 1731957114095,
  "prevMillis": 1731999600000,
  "attempts": 3,
  "backoff": {
    "type": "fixed",
    "delay": 180000
  }
}

Refactor

dheepak-aot commented 3 days ago

Great Job! Please have a look at the comments. Except one rest all are minor.

sonarcloud[bot] commented 3 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

github-actions[bot] commented 3 days ago

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.1% ( 3718 / 16821 )
Methods: 10.19% ( 214 / 2100 )
Lines: 25.44% ( 3226 / 12680 )
Branches: 13.62% ( 278 / 2041 )
github-actions[bot] commented 3 days ago

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 65.43% ( 583 / 891 )
Methods: 59.26% ( 64 / 108 )
Lines: 68.54% ( 464 / 677 )
Branches: 51.89% ( 55 / 106 )
github-actions[bot] commented 3 days ago

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 86.93% ( 1244 / 1431 )
Methods: 88.57% ( 124 / 140 )
Lines: 87.78% ( 1056 / 1203 )
Branches: 72.73% ( 64 / 88 )
github-actions[bot] commented 3 days ago

E2E SIMS API Coverage Report

Totals Coverage
Statements: 66.96% ( 5773 / 8621 )
Methods: 64.8% ( 718 / 1108 )
Lines: 70.89% ( 4530 / 6390 )
Branches: 46.75% ( 525 / 1123 )