Replica: Add priority field to server #28
Merged
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.
Questa PR replica la PR originale: postalserver#3446
Autore originale: @amirhasanzadehpy
Branch originale:
feature/server-priority-queueRepository originale: QueraTeam/postal
This introduces a server-level priority system to allow for more granular control over the message queue. By assigning a numerical priority to each mail server (with a higher number indicating higher priority), administrators can ensure that time-sensitive transactional emails are processed ahead of bulk newsletters or other less critical mail. This change modifies the message dequeuing logic to sort by server priority before the message ID, ensuring that all high-priority messages are sent first, while maintaining a fair first-in, first-out order for messages of the same priority. The feature is implemented with a default priority of 0 for all existing and new servers, making it a non-disruptive change that can be optionally configured after deployment.