• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 13918644911

18 Mar 2025 08:29AM UTC coverage: 51.06% (-6.7%) from 57.735%
13918644911

push

github

sweatybridge
chore(deps): bump supabase/studio in /pkg/config/templates

Bumps supabase/studio from 20250224-d10db0f to 20250317-6955350.

---
updated-dependencies:
- dependency-name: supabase/studio
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

6959 of 13629 relevant lines covered (51.06%)

186.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pkg/queue/queue.go
1
package queue
2

3
import (
4
        "sync"
5

6
        "github.com/go-errors/errors"
7
)
8

9
// JobQueue implements a background job processor using a single channel and wait group.
10
//
11
// The channel is initialised with a maximum number of concurrent workers. Adding a new job
12
// consumes a worker from the channel. After finishing a job, the worker is added back to
13
// the channel. When all workers are consumed, adding new job will block.
14
//
15
// Example usage:
16
//
17
//        jq := NewJobQueue(5)
18
//        err := jq.Put(func() error {
19
//                return nil
20
//        })
21
//        errors.Join(err, jq.Collect())
22
type JobQueue struct {
23
        wg    sync.WaitGroup
24
        errCh chan error
25
}
26

27
func NewJobQueue(maxConcurrency uint) *JobQueue {
×
28
        q := &JobQueue{
×
29
                errCh: make(chan error, maxConcurrency),
×
30
        }
×
31
        for i := 0; i < cap(q.errCh); i++ {
×
32
                q.errCh <- nil
×
33
        }
×
34
        return q
×
35
}
36

37
// Put runs a job in the background, returning any error from the previous job.
38
func (q *JobQueue) Put(job func() error) error {
×
39
        err := <-q.errCh
×
40
        q.wg.Add(1)
×
41
        go func() {
×
42
                defer q.wg.Done()
×
43
                q.errCh <- job()
×
44
        }()
×
45
        return err
×
46
}
47

48
// Collect waits for all jobs to finish, returning any errors.
49
func (q *JobQueue) Collect() error {
×
50
        q.wg.Wait()
×
51
        var err []error
×
52
        for i := 0; i < cap(q.errCh); i++ {
×
53
                err = append(err, <-q.errCh)
×
54
                q.errCh <- nil
×
55
        }
×
56
        return errors.Join(err...)
×
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc