File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
35
35
- Decimal package use a test function GetNumberLength instead of a
36
36
package-level function getNumberLength (#219 )
37
37
- Datetime location after encode + decode is unequal (#217 )
38
+ - queue.Take() returns an invalid task (#222 )
38
39
39
40
## [ 1.8.0] - 2022-08-17
40
41
Original file line number Diff line number Diff line change @@ -467,6 +467,14 @@ func (qd *queueData) DecodeMsgpack(d *decoder) error {
467
467
}
468
468
469
469
qd .task = & Task {data : qd .result , q : qd .q }
470
- d .Decode (& qd .task )
470
+ if err = d .Decode (& qd .task ); err != nil {
471
+ return err
472
+ }
473
+
474
+ if qd .task .Data () == nil {
475
+ // It may happen if the decoder has a code.Nil value inside. As a
476
+ // result, the task will not be decoded.
477
+ qd .task = nil
478
+ }
471
479
return nil
472
480
}
Original file line number Diff line number Diff line change @@ -29,13 +29,9 @@ func (t *Task) DecodeMsgpack(d *decoder) error {
29
29
return err
30
30
}
31
31
if t .data != nil {
32
- if err = d .Decode (t .data ); err != nil {
33
- return fmt .Errorf ("fffuuuu: %s" , err )
34
- }
35
- } else {
36
- if t .data , err = d .DecodeInterface (); err != nil {
37
- return err
38
- }
32
+ d .Decode (t .data )
33
+ } else if t .data , err = d .DecodeInterface (); err != nil {
34
+ return err
39
35
}
40
36
return nil
41
37
}
You can’t perform that action at this time.
0 commit comments