Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b3d3d194c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let nextRunAtMs = anchor; | ||
| while (nextRunAtMs <= now) { | ||
| nextRunAtMs += schedule.everyMs; |
There was a problem hiding this comment.
Compute next interval run in O(1) instead of looping
This loop advances one interval at a time from startAtMs, so an old high-frequency job (for example, every minute with an anchor months ago) can require hundreds of thousands of iterations each time nextRunAtMs is recomputed. Because this helper is used during timer start and after executions, the cost grows with job age and can cause avoidable CPU spikes. Compute the next tick with arithmetic based on (now - anchor) / everyMs to keep this path constant-time.
Useful? React with 👍 / 👎.
| const months = Array.from({ length: 12 }, (_value, index) => index + 1).filter( | ||
| (month) => (month - startMonth + 12) % intervalValue === 0 | ||
| ); |
There was a problem hiding this comment.
Reject month intervals that cannot be represented correctly
The month field is generated by selecting matching months inside a single year, which silently breaks intervals that do not divide 12. For example, an "every 5 months" input yields 1,6,11, producing gaps of 5, 5, then 2 months across year boundaries, so runs are not actually every 5 months as the UI suggests. Either constrain allowed month intervals (e.g., divisors of 12) or use a schedule encoding that preserves constant month spacing.
Useful? React with 👍 / 👎.
| await ipcBridge.cron.addJob.invoke({ | ||
| name: values.name.trim(), | ||
| schedule, | ||
| message: trimmedMessage, |
There was a problem hiding this comment.
Honor create-form enabled state when adding a cron job
In create mode the form exposes an enabled/disabled switch, but the create path ignores values.enabled and always calls addJob with the default enabled behavior. Users who set the new job to disabled will still get an active scheduled task immediately. Persist the requested state (or explicitly pause right after creation) so the UI control matches runtime behavior.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
- 在多语言文件中添加月度间隔不支持的提示信息 - 实现 isMonthIntervalSupported 函数验证月度间隔的有效性 - 在 CronJobDrawer 组件中添加月度间隔验证规则 - 支持在创建定时任务时指定启用状态 - 修复 CronService 中的 getNextEveryRunAtMs 计算逻辑 - 移除未使用的 CronMessageMeta 类型定义 - 添加相关单元测试验证功能正确性
合并冲突(无法自动解决)本 PR 与目标分支存在冲突,自动 rebase 未能干净解决。请手动 rebase 后重新 push: git fetch origin
git rebase origin/main
# 解决冲突后
git push --force-with-lease |
# Conflicts: # src/process/services/database/migrations.ts # src/renderer/pages/settings/components/SettingsPageWrapper.tsx # src/renderer/pages/settings/components/SettingsSider.tsx
|
@JAVA-LW 定时任务会大改哦,后面再看这里 |
Pull Request
Description
就是支持手动创建重复定时任务

Related Issues
#1809
Type of Change
Testing
Screenshots
Additional Context
Thank you for contributing to AionUi! 🎉