mirror of
https://github.com/tnb-labs/panel.git
synced 2026-08-31 01:12:17 +08:00
a2e46faab9
任务执行接入 context 并放入独立进程组,取消时整组杀死; 新增可选 CancelShell 清理钩子,远程下载、压缩、备份任务 取消后自动清理残留文件,备份改用独享临时目录避免误伤并发备份; 防重改为按语言无关的任务标识 Key 匹配 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
11 lines
157 B
Go
11 lines
157 B
Go
package types
|
|
|
|
import "context"
|
|
|
|
// TaskRunner 任务运行器接口
|
|
type TaskRunner interface {
|
|
Run(ctx context.Context)
|
|
Notify()
|
|
Cancel(id uint) bool
|
|
}
|