Fixes for hanging jobs, more verbose ci output

This commit is contained in:
Jamie Curnow
2024-11-12 15:36:38 +10:00
parent 47d7896301
commit 61c41b8ec3
5 changed files with 15 additions and 6 deletions

View File

@ -10,6 +10,7 @@ type Queue struct {
jobs chan Job
ctx context.Context
cancel context.CancelFunc
mu sync.Mutex
}
// Job - holds logic to perform some operations during queue execution.
@ -41,6 +42,8 @@ func (q *Queue) AddJobs(jobs []Job) {
// AddJob sends job to the channel.
func (q *Queue) AddJob(job Job) {
q.mu.Lock()
defer q.mu.Unlock()
q.jobs <- job
}