-
Notifications
You must be signed in to change notification settings - Fork 0
feat(cron): enhance job validation and refactor core logic #917
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
Conversation
- Added ValidateCronJob function in core/cron.go to centralize job validation - Introduced GetCronJobOrigin and GetCronJobSourceID helper functions - Moved validation logic from service/cron.go to core package - Improved retry policy validation in standalone_coordinator.go - Updated job source ID handling in user cron and workflow cron services - Fixed operation filter handling in request and TUS services
|
WalkthroughThe changes introduce centralized validation for cron jobs, add helper functions for extracting job origin and source ID, and update job registration to use the new validation logic. Retry policy validation is refactored for clarity, and pointer usage for the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CronService
participant Core
participant DB
participant Coordinator
User->>CronService: RegisterJob(job, retryPolicy)
CronService->>Core: ValidateCronJob(job)
Core-->>CronService: Validation result
CronService->>DB: Check for existing job
DB-->>CronService: Exists/Not exists
CronService->>DB: Create job record
DB-->>CronService: Job record created
CronService->>Coordinator: Enqueue job
Coordinator-->>CronService: Enqueue result
CronService-->>User: RegisterJob result
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (7)
🧰 Additional context used🧠 Learnings (4)📓 Common learnings
service/internal/cron/standalone_coordinator.go (1)
core/cron.go (1)
service/cron.go (2)
🧬 Code Graph Analysis (5)service/tus.go (1)
service/workflow_cron.go (1)
service/internal/user/cron.go (1)
core/cron.go (2)
service/cron.go (1)
🔇 Additional comments (12)
✨ 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:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
CodeRabbit Configuration File (
|
Summary by CodeRabbit
Bug Fixes
Refactor
Chores