2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-11-10 11:31:58 +08:00

Use explicit types for limit constants

This commit is contained in:
ashang 2022-03-29 21:30:10 +08:00 committed by GitHub
parent f94a65dc9f
commit 3f4f0c1daa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -348,7 +348,7 @@ func (r *RDB) Done(ctx context.Context, msg *base.TaskMessage) error {
argv := []interface{}{ argv := []interface{}{
msg.ID, msg.ID,
expireAt.Unix(), expireAt.Unix(),
math.MaxInt64, int64(math.MaxInt64),
} }
// Note: We cannot pass empty unique key when running this script in redis-cluster. // Note: We cannot pass empty unique key when running this script in redis-cluster.
if len(msg.UniqueKey) > 0 { if len(msg.UniqueKey) > 0 {
@ -458,7 +458,7 @@ func (r *RDB) MarkAsComplete(ctx context.Context, msg *base.TaskMessage) error {
statsExpireAt.Unix(), statsExpireAt.Unix(),
now.Unix() + msg.Retention, now.Unix() + msg.Retention,
encoded, encoded,
math.MaxInt64, int64(math.MaxInt64),
} }
// Note: We cannot pass empty unique key when running this script in redis-cluster. // Note: We cannot pass empty unique key when running this script in redis-cluster.
if len(msg.UniqueKey) > 0 { if len(msg.UniqueKey) > 0 {
@ -688,7 +688,7 @@ func (r *RDB) Retry(ctx context.Context, msg *base.TaskMessage, processAt time.T
processAt.Unix(), processAt.Unix(),
expireAt.Unix(), expireAt.Unix(),
isFailure, isFailure,
math.MaxInt64, int64(math.MaxInt64),
} }
return r.runScript(ctx, op, retryCmd, keys, argv...) return r.runScript(ctx, op, retryCmd, keys, argv...)
} }
@ -774,7 +774,7 @@ func (r *RDB) Archive(ctx context.Context, msg *base.TaskMessage, errMsg string)
cutoff.Unix(), cutoff.Unix(),
maxArchiveSize, maxArchiveSize,
expireAt.Unix(), expireAt.Unix(),
math.MaxInt64, int64(math.MaxInt64),
} }
return r.runScript(ctx, op, archiveCmd, keys, argv...) return r.runScript(ctx, op, archiveCmd, keys, argv...)
} }