mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-08 00:26:37 +08:00
async task framework
This commit is contained in:
@@ -28,13 +28,17 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
AsynqClient *asynq.Client
|
||||
scheduler *asynq.Scheduler
|
||||
schedulerOnce sync.Once
|
||||
)
|
||||
|
||||
func init() {
|
||||
AsynqClient = asynq.NewClient(task.RedisOpt)
|
||||
// AsynqClient 已在 task 包中初始化
|
||||
}
|
||||
|
||||
// GetAsynqClient 获取全局 AsynqClient
|
||||
func GetAsynqClient() *asynq.Client {
|
||||
return task.AsynqClient
|
||||
}
|
||||
|
||||
// StartScheduler 启动调度器
|
||||
|
||||
Reference in New Issue
Block a user