From 2f923186d95c84204aeff73f4603c3636e6ca838 Mon Sep 17 00:00:00 2001 From: Denis Gukov Date: Sun, 17 Nov 2024 20:47:28 +0000 Subject: [PATCH] fix(runners): check runner type in update --- db/bolt/global_runner.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/db/bolt/global_runner.go b/db/bolt/global_runner.go index 87b67443..108bae50 100644 --- a/db/bolt/global_runner.go +++ b/db/bolt/global_runner.go @@ -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) {