From 5ab3eb8a386f500fb49fa5e76cc71195e8b39fa4 Mon Sep 17 00:00:00 2001 From: pb Date: Tue, 27 May 2025 11:17:10 +0200 Subject: [PATCH] forgot to pass the mutex as pointer and unlock it --- models/workflow_execution/workflow_scheduler.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/workflow_execution/workflow_scheduler.go b/models/workflow_execution/workflow_scheduler.go index e08f960..7206d0f 100644 --- a/models/workflow_execution/workflow_scheduler.go +++ b/models/workflow_execution/workflow_scheduler.go @@ -90,7 +90,7 @@ func (ws *WorkflowSchedule) CheckBooking(wfID string, request *tools.APIRequest) var m sync.Mutex for _, b := range bookings { - go getBooking(l, b, request, wf, execs, bookings, errCh, m) + go getBooking(l, b, request, wf, execs, bookings, errCh, &m) } for i := 0; i < len(bookings); i++ { @@ -102,7 +102,7 @@ func (ws *WorkflowSchedule) CheckBooking(wfID string, request *tools.APIRequest) return true, wf, execs, bookings, nil } -func getBooking(l zerolog.Logger, b *booking.Booking, request *tools.APIRequest, wf *workflow.Workflow, execs []*WorkflowExecution, bookings []*booking.Booking, errCh chan error, m sync.Mutex) { +func getBooking(l zerolog.Logger, b *booking.Booking, request *tools.APIRequest, wf *workflow.Workflow, execs []*WorkflowExecution, bookings []*booking.Booking, errCh chan error, m *sync.Mutex) { m.Lock() // deep copy du caller @@ -112,6 +112,7 @@ func getBooking(l zerolog.Logger, b *booking.Booking, request *tools.APIRequest, errCh <- err return } + m.Unlock() // Delock bl := l.With().Str("booking", b.UUID).Logger() meth := request.Caller.URLS[tools.BOOKING][tools.GET]