File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed
Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 1313 runs-on : ubuntu-latest
1414 strategy :
1515 matrix :
16- go-version : ["oldstable", " stable"]
16+ go-version : ["stable"]
1717 env :
1818 VERBOSE : 1
1919
Original file line number Diff line number Diff line change 11module github.com/bxcodec/goqueue
22
3- go 1.22
3+ go 1.23
44
55require (
66 github.com/google/uuid v1.6.0
Original file line number Diff line number Diff line change @@ -65,17 +65,18 @@ func (qs *QueueService) Start(ctx context.Context) (err error) {
6565// Stop stops the queue service by stopping the consumer and closing the publisher.
6666// It returns an error if there was an issue stopping the consumer or closing the publisher.
6767func (qs * QueueService ) Stop (ctx context.Context ) error {
68- if qs .consumer == nil {
69- return errors .New ("consumer is not defined" )
70- }
71- err := qs .consumer .Stop (ctx )
72- if err != nil {
73- return err
68+ if qs .consumer != nil {
69+ err := qs .consumer .Stop (ctx )
70+ if err != nil {
71+ return err
72+ }
7473 }
7574
76- err = qs .publisher .Close (ctx )
77- if err != nil {
78- return err
75+ if qs .publisher != nil {
76+ err := qs .publisher .Close (ctx )
77+ if err != nil {
78+ return err
79+ }
7980 }
8081 return nil
8182}
You can’t perform that action at this time.
0 commit comments