From e2f43bee7e4bb13bc0553d371f9ea162e3861c22 Mon Sep 17 00:00:00 2001 From: fiftin Date: Sat, 10 Feb 2024 18:59:56 +0500 Subject: [PATCH] fix(schedule): parallel tasks with boltdb (https://github.com/ansible-semaphore/semaphore/issues/1211) --- services/schedules/SchedulePool.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/schedules/SchedulePool.go b/services/schedules/SchedulePool.go index b6cefaca..9e80fd4f 100644 --- a/services/schedules/SchedulePool.go +++ b/services/schedules/SchedulePool.go @@ -1,6 +1,7 @@ package schedules import ( + "strconv" "sync" log "github.com/Sirupsen/logrus" @@ -53,8 +54,8 @@ func (r ScheduleRunner) tryUpdateScheduleCommitHash(schedule db.Schedule) (updat func (r ScheduleRunner) Run() { if !r.pool.store.PermanentConnection() { - r.pool.store.Connect("schedule") - defer r.pool.store.Close("schedule") + r.pool.store.Connect("schedule " + strconv.Itoa(r.scheduleID)) + defer r.pool.store.Close("schedule " + strconv.Itoa(r.scheduleID)) } schedule, err := r.pool.store.GetSchedule(r.projectID, r.scheduleID)