2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-10-07 18:42:02 +08:00

don't archive if our max size is 0

This commit is contained in:
Herb Stahl
2022-05-09 06:55:23 -07:00
parent d2fc04a2e6
commit c19a8c56d7

View File

@@ -899,6 +899,9 @@ return redis.status_reply("OK")`)
// Archive sends the given task to archive, attaching the error message to the task.
// It also trims the archive by timestamp and set size.
func (r *RDB) Archive(ctx context.Context, msg *base.TaskMessage, errMsg string) error {
if *(r.config.MaxArchiveSize) <= 0 {
return nil
}
var op errors.Op = "rdb.Archive"
now := r.clock.Now()
modified := *msg