chore: clean up worker jobs#524
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis set of changes refactors job dispatching and retry logic in several worker modules, consolidating repeated job enqueueing logic into a utility function and removing retry delays for row lock errors. Additionally, transaction handling is made more explicit in the policy update API route by wrapping updates within a transaction. Debugging and logging statements are removed from certain modules to clean up output, but no public interfaces or exported function signatures are altered. Changes
Sequence Diagram(s)sequenceDiagram
participant API as PATCH /policies/[policyId]
participant DB as Database
participant updatePolicy as updatePolicyInTx
API->>DB: Begin transaction
API->>updatePolicy: updatePolicyInTx(tx, ...)
updatePolicy-->>DB: Execute update in transaction
updatePolicy-->>API: Return result
API->>DB: Commit transaction
API-->>Client: Return response
sequenceDiagram
participant Worker as Worker
participant dispatchUtil as dispatchEvaluateJobs
participant Queue as Job Queue
Worker->>dispatchUtil: dispatchEvaluateJobs(releaseTargets)
dispatchUtil->>Queue: Enqueue jobs for each release target
Queue-->>dispatchUtil: Jobs added
dispatchUtil-->>Worker: Done
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (7)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Summary by CodeRabbit
Refactor
Style