-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add env var feature flag to enable queueing library #1004
base: main
Are you sure you want to change the base?
Add env var feature flag to enable queueing library #1004
Conversation
7605b2d
to
130b32d
Compare
@@ -632,6 +632,7 @@ func (h *Handler) bulkRequest(w http.ResponseWriter, r *http.Request, reqType se | |||
sinceParam := (!rp.Since.IsZero() || conditions.ReqType == service.RetrieveNewBeneHistData) | |||
jobPriority := h.Svc.GetJobPriority(conditions.CMSID, j.ResourceType, sinceParam) // first argument is the CMS ID, not the ACO uuid | |||
|
|||
logger.Infof("Adding jobs using %T", h.Enq) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sanity check logging that we are are using the proper queueing library. I dont totally understand why we seem to have different loggers and different access to them?
return riverEnqueuer{} | ||
} else { | ||
panic("NO QUEUE LIBRARY SET") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if panic-ing is better than just defaulting to a specific library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going to a green-blue solution for the libraries I'd just default to que-go.
@@ -67,3 +74,13 @@ func (q queEnqueuer) AddAlrJob(job models.JobAlrEnqueueArgs, priority int) error | |||
|
|||
return q.Enqueue(j) | |||
} | |||
|
|||
type riverEnqueuer struct{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dummy type and interface for now.
@@ -10,6 +10,7 @@ BCDA_WORKER_ERROR_LOG=/var/log/worker/error.log | |||
DEBUG=true | |||
DEPLOYMENT_TARGET=dev | |||
EXPIRED_THRESHOLD_HR=24 | |||
QUEUE_LIBRARY=que-go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files are the non-sensitive env vars used for each environment?
🎫 Ticket
https://jira.cms.gov/browse/BCDA-8426
🛠 Changes
Enable swapping of queueing libraries based on env var.
ℹ️ Context
This is an initial stepping stone in the process of replacing our queueing library. This PR specifically sets up the ability to switch between queueing libraries with a restart. See https://confluence.cms.gov/display/BCDA/2024-09-26%3A+Replace+Queue+Library for more context.
🧪 Validation
Full test suite and linting pass.