mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 04:30:05 +00:00
feat: edit server config online (#980)
* feat: edit server config online * clean * refactor * generate template * fix deadlocks * fix
This commit is contained in:
@@ -24,6 +24,8 @@ const (
|
||||
TaskTypeNAT
|
||||
TaskTypeReportHostInfoDeprecated
|
||||
TaskTypeFM
|
||||
TaskTypeReportConfig
|
||||
TaskTypeApplyConfig
|
||||
)
|
||||
|
||||
type TerminalTask struct {
|
||||
@@ -127,5 +129,12 @@ func (m *Service) AfterFind(tx *gorm.DB) error {
|
||||
|
||||
// IsServiceSentinelNeeded 判断该任务类型是否需要进行服务监控 需要则返回true
|
||||
func IsServiceSentinelNeeded(t uint64) bool {
|
||||
return t != TaskTypeCommand && t != TaskTypeTerminalGRPC && t != TaskTypeUpgrade && t != TaskTypeKeepalive
|
||||
switch t {
|
||||
case TaskTypeCommand, TaskTypeTerminalGRPC, TaskTypeUpgrade,
|
||||
TaskTypeKeepalive, TaskTypeNAT, TaskTypeFM,
|
||||
TaskTypeReportConfig, TaskTypeApplyConfig:
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user