Fetch latest RT secrets every minute #2876
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.
Description
Describe your changes and why you're making them. Please include the context, motivation, and relevant dependencies.
Resolves #1938
(see https://cal-itp.slack.com/archives/C01FNDG1ZPA/p1691601423249999)
Note: I'm choosing an easier/simpler implementation that uses the ticker to grab and pass auth keys in task calls. This means secrets are serialized into Redis, but it's not a huge deal since we don't persist/backup Redis.
Also, fetching secrets when we fetch configs does add to the fetch delay every 5 minutes. The alternative would be a separate scheduled function call, which I am going to experiment with. (We could use this same scheduled call to update the configs and reduce delay even more).I implemented this; the same scheduler that calls
tick
now loads configs and secrets at theXX:45
every minute.Type of change
How has this been tested?
Include commands/logs/screenshots as relevant.
Testing locally and will deploy to test first.
Post-merge follow-ups
Document any actions that must be taken post-merge to deploy or otherwise implement the changes in this PR (for example, running a full refresh of some incremental model in dbt). If these actions will take more than a few hours after the merge or if they will be completed by someone other than the PR author, please create a dedicated follow-up issue and link it here to track resolution.
Deploy to prod.