Browse Source

updated createTaskLogic

pull/358/head
tzwang 11 months ago
parent
commit
acf99f0019
1 changed files with 11 additions and 5 deletions
  1. +11
    -5
      internal/logic/schedule/schedulecreatetasklogic.go

+ 11
- 5
internal/logic/schedule/schedulecreatetasklogic.go View File

@@ -18,15 +18,17 @@ import (

type ScheduleCreateTaskLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
ctx context.Context
svcCtx *svc.ServiceContext
queryResource *QueryResourcesLogic
}

func NewScheduleCreateTaskLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ScheduleCreateTaskLogic {
return &ScheduleCreateTaskLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
queryResource: NewQueryResourcesLogic(ctx, svcCtx),
}
}

@@ -77,6 +79,10 @@ func (l *ScheduleCreateTaskLogic) ScheduleCreateTask(req *types.CreateTaskReq) (
}

if len(req.Resources) != 0 {
_, err := l.queryResource.QueryResources(&types.QueryResourcesReq{AdapterId: req.AdapterId})
if err != nil {
return nil, err
}
return
}
return


Loading…
Cancel
Save