feat: Implement core backend API server, S2A integration, auto-add service, and a new monitoring page.
This commit is contained in:
@@ -78,9 +78,8 @@ func main() {
|
||||
}
|
||||
fmt.Println()
|
||||
|
||||
// 启动自动补号服务
|
||||
// 启动自动补号检查器(需在前端开启开关才会实际补号)
|
||||
api.StartAutoAddService()
|
||||
fmt.Printf("%s[服务]%s 自动补号服务已启动\n", colorGreen, colorReset)
|
||||
|
||||
// 启动服务器
|
||||
startServer(cfg)
|
||||
|
||||
@@ -19,7 +19,7 @@ var (
|
||||
lastAutoAddTime time.Time
|
||||
)
|
||||
|
||||
// StartAutoAddService 启动自动补号服务
|
||||
// StartAutoAddService 启动自动补号服务(后台检查器)
|
||||
func StartAutoAddService() {
|
||||
autoAddMu.Lock()
|
||||
if autoAddRunning {
|
||||
@@ -30,7 +30,8 @@ func StartAutoAddService() {
|
||||
autoAddStopChan = make(chan struct{})
|
||||
autoAddMu.Unlock()
|
||||
|
||||
logger.Info("自动补号服务已启动", "", "auto-add")
|
||||
// 注意:这只是启动后台检查器,实际补号需要前端开启开关
|
||||
logger.Info("自动补号检查器已启动(需在前端开启开关)", "", "auto-add")
|
||||
|
||||
go func() {
|
||||
ticker := time.NewTicker(60 * time.Second) // 每分钟检查一次
|
||||
@@ -39,7 +40,7 @@ func StartAutoAddService() {
|
||||
for {
|
||||
select {
|
||||
case <-autoAddStopChan:
|
||||
logger.Info("自动补号服务已停止", "", "auto-add")
|
||||
logger.Info("自动补号检查器已停止", "", "auto-add")
|
||||
return
|
||||
case <-ticker.C:
|
||||
checkAndAutoAdd()
|
||||
|
||||
Reference in New Issue
Block a user