File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed
backend/internal/jobqueue Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change 16
16
func Start () {
17
17
ctx , cancel = context .WithCancel (context .Background ())
18
18
q := & Queue {
19
- jobs : make (chan Job , 10 ),
19
+ jobs : make (chan Job , 50 ),
20
20
ctx : ctx ,
21
21
cancel : cancel ,
22
22
}
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ type Queue struct {
17
17
type Job struct {
18
18
Name string
19
19
Action func () error // A function that should be executed when the job is running.
20
- Done chan bool // A channel that should be closed when the job is done.
21
20
}
22
21
23
22
// AddJobs adds jobs to the queue and cancels channel.
@@ -49,12 +48,5 @@ func (q *Queue) AddJob(job Job) {
49
48
50
49
// Run performs job execution.
51
50
func (j * Job ) Run () error {
52
- err := j .Action ()
53
- if err != nil {
54
- j .Done <- true
55
- return err
56
- }
57
-
58
- j .Done <- true
59
- return nil
51
+ return j .Action ()
60
52
}
You can’t perform that action at this time.
0 commit comments