调整文件命名
This commit is contained in:
@@ -41,7 +41,7 @@ func (app *Application) initializeSystemPlans() error {
|
||||
predefinedSystemPlans := app.getPredefinedSystemPlans()
|
||||
|
||||
// 1. 获取所有已存在的系统计划
|
||||
existingPlans, _, err := app.Infra.Repos.PlanRepo.ListPlans(repository.ListPlansOptions{
|
||||
existingPlans, _, err := app.Infra.repos.planRepo.ListPlans(repository.ListPlansOptions{
|
||||
PlanType: repository.PlanTypeFilterSystem,
|
||||
}, 1, 99999) // 使用一个较大的 pageSize 来获取所有系统计划
|
||||
if err != nil {
|
||||
@@ -66,7 +66,7 @@ func (app *Application) initializeSystemPlans() error {
|
||||
predefinedPlan.ID = foundExistingPlan.ID
|
||||
predefinedPlan.ExecuteCount = foundExistingPlan.ExecuteCount
|
||||
|
||||
if err := app.Infra.Repos.PlanRepo.UpdatePlan(predefinedPlan); err != nil {
|
||||
if err := app.Infra.repos.planRepo.UpdatePlan(predefinedPlan); err != nil {
|
||||
return fmt.Errorf("更新预定义计划 '%s' 失败: %w", predefinedPlan.Name, err)
|
||||
} else {
|
||||
app.Logger.Infof("成功更新预定义计划 '%s'。", predefinedPlan.Name)
|
||||
@@ -74,7 +74,7 @@ func (app *Application) initializeSystemPlans() error {
|
||||
} else {
|
||||
// 如果计划不存在, 则创建
|
||||
app.Logger.Infof("预定义计划 '%s' 不存在,正在创建...", predefinedPlan.Name)
|
||||
if err := app.Infra.Repos.PlanRepo.CreatePlan(predefinedPlan); err != nil {
|
||||
if err := app.Infra.repos.planRepo.CreatePlan(predefinedPlan); err != nil {
|
||||
return fmt.Errorf("创建预定义计划 '%s' 失败: %w", predefinedPlan.Name, err)
|
||||
} else {
|
||||
app.Logger.Infof("成功创建预定义计划 '%s'。", predefinedPlan.Name)
|
||||
@@ -123,7 +123,7 @@ func (app *Application) initializePendingCollections() error {
|
||||
app.Logger.Info("开始清理所有未完成的采集请求...")
|
||||
|
||||
// 直接将所有 'pending' 状态的请求更新为 'timed_out'。
|
||||
count, err := app.Infra.Repos.PendingCollectionRepo.MarkAllPendingAsTimedOut()
|
||||
count, err := app.Infra.repos.pendingCollectionRepo.MarkAllPendingAsTimedOut()
|
||||
if err != nil {
|
||||
return fmt.Errorf("清理未完成的采集请求失败: %v", err)
|
||||
} else if count > 0 {
|
||||
@@ -138,9 +138,9 @@ func (app *Application) initializePendingCollections() error {
|
||||
// initializePendingTasks 在应用启动时清理并刷新待执行任务列表。
|
||||
func (app *Application) initializePendingTasks() error {
|
||||
logger := app.Logger
|
||||
planRepo := app.Infra.Repos.PlanRepo
|
||||
pendingTaskRepo := app.Infra.Repos.PendingTaskRepo
|
||||
executionLogRepo := app.Infra.Repos.ExecutionLogRepo
|
||||
planRepo := app.Infra.repos.planRepo
|
||||
pendingTaskRepo := app.Infra.repos.pendingTaskRepo
|
||||
executionLogRepo := app.Infra.repos.executionLogRepo
|
||||
planService := app.Domain.planService
|
||||
|
||||
logger.Info("开始初始化待执行任务列表...")
|
||||
|
||||
Reference in New Issue
Block a user