Skip to content

Commit

Permalink
cloudcommon: taskman: fix table insert
Browse files Browse the repository at this point in the history
Fix the following error

	run error: reflect: NumField of non-struct type *taskman.STask

Fixes 08cd41b ("cloudcommon: taskman: SetModelManager")

Reported-by: Qu Xuan <quxuan@yunionyun.com>
  • Loading branch information
yousong committed Jun 30, 2020
1 parent 5de04eb commit 9868782
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cloudcommon/db/taskman/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (manager *STaskManager) NewTask(
Stage: TASK_INIT_STAGE,
}
task.SetModelManager(manager, task)
err := manager.TableSpec().Insert(ctx, &task)
err := manager.TableSpec().Insert(ctx, task)
if err != nil {
log.Errorf("Task insert error %s", err)
return nil, err
Expand Down Expand Up @@ -313,7 +313,7 @@ func (manager *STaskManager) NewParallelTask(
Stage: TASK_INIT_STAGE,
}
task.SetModelManager(manager, task)
err := manager.TableSpec().Insert(ctx, &task)
err := manager.TableSpec().Insert(ctx, task)
if err != nil {
log.Errorf("Task insert error %s", err)
return nil, err
Expand Down

0 comments on commit 9868782

Please sign in to comment.