🔄 Refactor: Additional Refactoring of Jobs#4549
Open
MrAdder wants to merge 17 commits intoVATSIM-UK:mainfrom
Open
🔄 Refactor: Additional Refactoring of Jobs#4549MrAdder wants to merge 17 commits intoVATSIM-UK:mainfrom
MrAdder wants to merge 17 commits intoVATSIM-UK:mainfrom
Conversation
5 tasks
Contributor
Author
|
Removed the Refactor for the Forums as its now been removed |
Contributor
Author
|
@kristiankunc or @CLC0609 These work fine locally and will not break the site, due to restrictions on my side I can not test the full functionality to Helpdesk or moodle so thats all that will need testing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces consistent queue configuration, rate limiting, overlap protection, and improved observability across MSHIP and Training jobs. It also updates Horizon to ensure the new dedicated queues are actively consumed by workers.
The goal is to:
MSHIP Sync Jobs
Updated the following jobs:
SyncToCTSSyncToDiscordSyncToHelpdeskSyncToMoodleChanges
Accountproperty.$tries = 3$backoff = 30$queueper service (cts,discord,forums,helpdesk,moodle)failed(Throwable $exception)logging.RateLimitedWithRedis('<service>-sync')WithoutOverlapping($accountId)with:releaseAfter(5)expireAfter(120)This ensures:
Training Jobs
Updated:
ActionWaitingListRetentionCheckRemovalSendWaitingListRetentionCheckUpdateAccountWaitingListEligibilityChanges
$tries = 3$backoff(30 for retention jobs, 15 for eligibility)training-retentiontraining-eligibilityfailed(Throwable $exception)logging.RateLimitedWithRedis(...)WithoutOverlapping(...)with scoped keys:retention-check:{id}waiting-list-account:{id}account:{id}Behaviour Improvements
Discord Listener Adjustment
SetupDiscordUser:->onQueue('default').SyncToDiscordto self-route to the dedicateddiscordqueue.This aligns job routing with the new queue architecture.
Horizon Configuration
Updated
config/horizon.php:Queues now include:
This ensures dedicated service queues are actually consumed by workers in both
productionandlocal.Tests Added
MSHIP
SyncJobConfigurationTesttriesbackoffRateLimitedWithRedis,WithoutOverlapping)Training
TrainingJobConfigurationTestResult
This PR:
This lays groundwork for safer horizontal scaling and improved operational visibility.