qinglong/back/services
Copilot 03c7031a3c
Fix task duplication: add single/multi-instance support with UI configuration and stop all running instances (#2837)
* Initial plan

* Stop running tasks before starting new scheduled instance

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

* Add multi-instance support and fix stop to kill all running instances

- Add allow_multiple_instances field to Crontab model (default: 0 for single instance)
- Add validation for new field in commonCronSchema
- Add getAllPids and killAllTasks utility functions
- Update stop method to kill ALL running instances of a task
- Update runCron to respect allow_multiple_instances config
- Backward compatible: defaults to single instance mode

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

* Add UI support for allow_multiple_instances configuration

- Add allow_multiple_instances field to ICrontab interface
- Add instance mode selector in task creation/edit modal
- Add translations for instance mode in Chinese and English
- Default to single instance mode for backward compatibility

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

* Add allow_multiple_instances column migration and optimize db.ts

- Add allow_multiple_instances column to Crontabs table migration
- Refactor migration code to use data-driven approach
- Replace 11 individual try-catch blocks with single loop
- Improve code maintainability and readability

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-19 00:10:27 +08:00
..
config.ts 修改 import undici 2025-05-15 01:19:24 +08:00
cron.ts Fix task duplication: add single/multi-instance support with UI configuration and stop all running instances (#2837) 2025-11-19 00:10:27 +08:00
cronView.ts 修复系统设置数据未初始化 2024-06-12 13:53:45 +08:00
dependence.ts Add validation to dependencies GET endpoint and update service logic (#2778) 2025-10-11 23:23:13 +08:00
env.ts 环境变量支持置顶 (#2822) 2025-11-09 19:43:33 +08:00
grpc.ts 修改服务启动逻辑 2025-05-07 09:30:00 +08:00
health.ts 修改服务启动逻辑 2025-05-07 09:30:00 +08:00
http.ts 修复登录通知失败造成服务重启 2025-05-11 14:36:16 +08:00
log.ts 脚本管理和日志管理支持下载 2025-03-13 00:22:24 +08:00
metrics.ts 修改服务启动逻辑 2025-05-07 09:30:00 +08:00
notify.ts QLAPI.systemNotify 支持自定义通知类型和参数 2025-06-24 02:00:51 +08:00
open.ts QLAPI 支持操作环境变量和系统通知 2025-01-11 01:59:46 +08:00
schedule.ts 修复模块注入 2025-10-26 22:32:03 +08:00
script.ts 脚本管理和日志管理支持下载 2025-03-13 00:22:24 +08:00
sock.ts 修复调试脚本日志丢失 2023-09-22 00:46:16 +08:00
sshKey.ts 修复模块注入 2025-10-26 22:32:03 +08:00
subscription.ts Optimize log file writes using stream pooling (#2835) 2025-11-16 21:11:10 +08:00
system.ts 修复 command-run 接口日志绑定 2025-07-12 20:29:44 +08:00
user.ts 修复重置用户名失败 2025-05-15 01:12:01 +08:00