fix(runners): check runner type in update
Some checks failed
Dev / build-local (push) Has been cancelled
Dev / migrate-boltdb (push) Has been cancelled
Dev / migrate-mysql (push) Has been cancelled
Dev / migrate-mariadb (push) Has been cancelled
Dev / migrate-postgres (push) Has been cancelled
Dev / integrate-boltdb (push) Has been cancelled
Dev / integrate-mysql (push) Has been cancelled
Dev / integrate-mariadb (push) Has been cancelled
Dev / integrate-postgres (push) Has been cancelled
Dev / deploy-server (push) Has been cancelled
Dev / deploy-runner (push) Has been cancelled

This commit is contained in:
Denis Gukov 2024-11-17 20:47:28 +00:00
parent d807aa2c27
commit 2f923186d9

View File

@ -54,7 +54,11 @@ func (d *BoltDb) DeleteGlobalRunner(runnerID int) (err error) {
}
func (d *BoltDb) UpdateRunner(runner db.Runner) (err error) {
return d.updateObject(0, db.GlobalRunnerProps, runner)
if runner.ProjectID == nil {
return d.updateObject(0, db.GlobalRunnerProps, runner)
} else {
return d.updateObject(*runner.ProjectID, db.RunnerProps, runner)
}
}
func (d *BoltDb) CreateRunner(runner db.Runner) (newRunner db.Runner, err error) {