2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 09:13:49 +08:00

feat: 数据库同步及fail2ban重构

This commit is contained in:
耗子
2024-11-22 22:46:26 +08:00
parent e1f074f116
commit 214b804062
38 changed files with 287 additions and 230 deletions

View File

@@ -3,21 +3,18 @@ package data
import (
"fmt"
"log/slog"
"sync"
"github.com/samber/do/v2"
"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/queuejob"
)
var taskDispatchOnce sync.Once
type taskRepo struct{}
func NewTaskRepo() biz.TaskRepo {
task := &taskRepo{}
taskDispatchOnce.Do(task.DispatchWaiting)
return &taskRepo{}
return do.MustInvoke[biz.TaskRepo](injector)
}
func (r *taskRepo) HasRunningTask() bool {