This PR attempts to resolve multiple issues regarding the handling of the state of the Redis Queue:
The current design of the GradingQueueService in the web server did not allow for combining multiple operations. For example, an upcoming feature is being able to release jobs from a "holding pen" once the image they require is built. Upon releasing them from the holding pen, they then should be added to the queue 1-by-1. However, the implementation of creating and updating jobs did not allow to build upon a pre-existing transaction (e.g., Redis multi command) OR to utilize the same lock in a given operation.
Nonces could utilize a more sound uniqueness logic in the form of UUIDs.
Solution (Changes Made)
Removal of GradingQueueService; instead, the web server now implements operations that can take in a RedisTransactionBuilder and return the same instance with the new steps tacked on. This allows multiple operations to be included in a single transaction.
RedisTransactionBuilder now fetches the previous state of the queue in its own logic, vs. asking for external input to verify this logic.
Additional Notes/Changes
DevEx improved by allowing the web-server to watch for changes to the .ts source files; i.e., developers can leave docker compose running and have their changes reflected.
Feature/Problem Description
This PR attempts to resolve multiple issues regarding the handling of the state of the Redis Queue:
GradingQueueService
in the web server did not allow for combining multiple operations. For example, an upcoming feature is being able to release jobs from a "holding pen" once the image they require is built. Upon releasing them from the holding pen, they then should be added to the queue 1-by-1. However, the implementation of creating and updating jobs did not allow to build upon a pre-existing transaction (e.g., Redismulti
command) OR to utilize the same lock in a given operation.Solution (Changes Made)
GradingQueueService
; instead, the web server now implements operations that can take in aRedisTransactionBuilder
and return the same instance with the new steps tacked on. This allows multiple operations to be included in a single transaction.RedisTransactionBuilder
now fetches the previous state of the queue in its own logic, vs. asking for external input to verify this logic.Additional Notes/Changes
.ts
source files; i.e., developers can leavedocker compose
running and have their changes reflected.