mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-09 08:21:25 +01:00
fix: fix error bitsize of jobservice reaper scan locks (#18487)
Change the bitSize from 16 to 64 in the jobservice reaper, the 16 is too small when the redis cursor over the max value of int16. Fixes: #18486 Signed-off-by: chlins <chenyuzh@vmware.com>
This commit is contained in:
parent
499940a8a7
commit
5791f0c979
@ -245,7 +245,7 @@ func (r *reaper) scanLocks(key string, handler func(k string, v int64) error) er
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get next cursor
|
// Get next cursor
|
||||||
cursor, err = strconv.ParseInt(string(reply[0].([]uint8)), 10, 16)
|
cursor, err = strconv.ParseInt(string(reply[0].([]uint8)), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "scan locks")
|
return errors.Wrap(err, "scan locks")
|
||||||
}
|
}
|
||||||
@ -253,7 +253,7 @@ func (r *reaper) scanLocks(key string, handler func(k string, v int64) error) er
|
|||||||
if values, ok := reply[1].([]interface{}); ok {
|
if values, ok := reply[1].([]interface{}); ok {
|
||||||
for i := 0; i < len(values); i += 2 {
|
for i := 0; i < len(values); i += 2 {
|
||||||
k := string(values[i].([]uint8))
|
k := string(values[i].([]uint8))
|
||||||
lc, err := strconv.ParseInt(string(values[i+1].([]uint8)), 10, 16)
|
lc, err := strconv.ParseInt(string(values[i+1].([]uint8)), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Ignore and continue
|
// Ignore and continue
|
||||||
logger.Errorf("Malformed lock object for %s: %v", k, err)
|
logger.Errorf("Malformed lock object for %s: %v", k, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user