Skip to content

Commit 1551f8c

Browse files
committed
fix: check for queueing being empty
1 parent 186b7f6 commit 1551f8c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

internal/scheduling/policy_default.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package scheduling
22

33
import (
44
"errors"
5+
"log"
6+
57
"github.com/serverledge-faas/serverledge/internal/container"
68
"github.com/serverledge-faas/serverledge/internal/function"
7-
"log"
89

910
"github.com/serverledge-faas/serverledge/internal/config"
1011
"github.com/serverledge-faas/serverledge/internal/node"
@@ -33,9 +34,9 @@ func (p *DefaultLocalPolicy) OnCompletion(_ *function.Function, _ *function.Exec
3334
p.queue.Lock()
3435
defer p.queue.Unlock()
3536

36-
tryDequeueing := !p.queue.isEmpty()
37+
tryDequeueing := true
3738

38-
for tryDequeueing {
39+
for !p.queue.isEmpty() && tryDequeueing {
3940
req := p.queue.front()
4041

4142
containerID, _, err := node.AcquireContainer(req.Fun, true)

0 commit comments

Comments
 (0)