Files
EdgeAPI/internal/tasks/task_base.go
GoEdgeLab 5a17ae9d79 v1.4.1
2024-07-27 14:15:25 +08:00

20 lines
514 B
Go

// Copyright 2022 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cloud .
package tasks
import (
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
)
type BaseTask struct {
}
func (this *BaseTask) logErr(taskType string, errString string) {
remotelogs.Error("TASK", "run '"+taskType+"' failed: "+errString)
}
func (this *BaseTask) IsPrimaryNode() bool {
return models.SharedAPINodeDAO.CheckAPINodeIsPrimaryWithoutErr()
}