forked from bitleak/lmstfy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support of parsing job body format according to the job id version (
bitleak#225) Currently, we store the job payload in Redis without any encoding, so it's possible to extend more fields for a job like attributes, etc. To mitigate this issue, we introduce the version prefix for the job id to identify different job payload formats. Use the length to tell if it's a legacy id or not since the ulid's id is a fixed-length string(26 chars). That said, we will return the value as the job body directly if the length is 26. Otherwise, decode it in JSON format. To avoid introducing breaking changes during the upgrade stage, we add a new HTTP header: Enable-Job-Version to enable this feature. The new job format would be enabled only if the header `Enable-Job-Version: yes` was explicitly passed in the publish request. So that we can smoothly support the new job payload format by upgrading the server first, and enabling it on the client side since then.
- Loading branch information
Showing
8 changed files
with
184 additions
and
128 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.