mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-07 10:40:25 +08:00
多个API节点时选择一个作为主节点/优化任务相关代码
This commit is contained in:
@@ -1,26 +1,28 @@
|
||||
package tasks
|
||||
package tasks_test
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/tasks"
|
||||
"github.com/iwind/TeaGo/dbs"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestLogTask_loopClean(t *testing.T) {
|
||||
func TestLogTask_LoopClean(t *testing.T) {
|
||||
dbs.NotifyReady()
|
||||
|
||||
task := NewLogTask()
|
||||
err := task.loopClean()
|
||||
var task = tasks.NewLogTask(24*time.Hour, 1*time.Minute)
|
||||
err := task.LoopClean()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log("ok")
|
||||
}
|
||||
|
||||
func TestLogTask_loopMonitor(t *testing.T) {
|
||||
func TestLogTask_LoopMonitor(t *testing.T) {
|
||||
dbs.NotifyReady()
|
||||
|
||||
task := NewLogTask()
|
||||
err := task.loopMonitor(10)
|
||||
var task = tasks.NewLogTask(24*time.Hour, 1*time.Minute)
|
||||
err := task.LoopMonitor()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user