mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 06:56:10 +08:00
v2.0
This commit is contained in:
29
server/internal/crons/test.go
Normal file
29
server/internal/crons/test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Package crons
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package crons
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Test 测试任务
|
||||
var Test = &cTest{name: "test"}
|
||||
|
||||
type cTest struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func (c *cTest) GetName() string {
|
||||
return c.name
|
||||
}
|
||||
|
||||
// Execute 执行任务
|
||||
func (c *cTest) Execute(ctx context.Context) {
|
||||
g.Log().Infof(ctx, "cron test Execute:%v", time.Now())
|
||||
}
|
Reference in New Issue
Block a user