2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-12-27 00:02:19 +08:00

fix: resolve go vet lint

This commit is contained in:
MinJae Kwon 2020-12-20 23:09:51 +09:00 committed by GitHub
parent 37dfd746d4
commit c4dc993241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 7 deletions

View File

@ -414,7 +414,6 @@ func (i *Inspector) ListDeadTasks(qname string, opts ...ListOption) ([]*DeadTask
}) })
} }
return tasks, nil return tasks, nil
return nil, nil
} }
// DeleteAllScheduledTasks deletes all scheduled tasks from the specified queue, // DeleteAllScheduledTasks deletes all scheduled tasks from the specified queue,

View File

@ -1830,7 +1830,12 @@ func TestInspectorKillTaskByKeyKillsScheduledTask(t *testing.T) {
}, },
wantDead: map[string][]base.Z{ wantDead: map[string][]base.Z{
"default": {}, "default": {},
"custom": {{m2, now.Unix()}}, "custom": {
{
Message: m2,
Score: now.Unix(),
},
},
}, },
}, },
} }
@ -1900,7 +1905,12 @@ func TestInspectorKillTaskByKeyKillsRetryTask(t *testing.T) {
}, },
wantDead: map[string][]base.Z{ wantDead: map[string][]base.Z{
"default": {}, "default": {},
"custom": {{m2, now.Unix()}}, "custom": {
{
Message: m2,
Score: now.Unix(),
},
},
}, },
}, },
} }

View File

@ -363,14 +363,14 @@ func TestStatusConcurrentAccess(t *testing.T) {
go func() { go func() {
defer wg.Done() defer wg.Done()
status.Get() status.Get()
status.String() _ = status.String()
}() }()
wg.Add(1) wg.Add(1)
go func() { go func() {
defer wg.Done() defer wg.Done()
status.Set(StatusStopped) status.Set(StatusStopped)
status.String() _ = status.String()
}() }()
wg.Wait() wg.Wait()

View File

@ -353,7 +353,7 @@ func (r *RDB) listZSetEntries(key string, pgn Pagination) ([]base.Z, error) {
if err != nil { if err != nil {
continue // bad data, ignore and continue continue // bad data, ignore and continue
} }
res = append(res, base.Z{msg, int64(z.Score)}) res = append(res, base.Z{Message: msg, Score: int64(z.Score)})
} }
return res, nil return res, nil
} }

View File

@ -3050,7 +3050,15 @@ func TestSchedulerEnqueueEvents(t *testing.T) {
}{ }{
{ {
entryID: "entry123", entryID: "entry123",
events: []*base.SchedulerEnqueueEvent{{"task123", oneDayAgo}, {"task456", oneHourAgo}}, events: []*base.SchedulerEnqueueEvent{
{
TaskID: "task123",
EnqueuedAt: oneDayAgo,
}, {
TaskID: "task456",
EnqueuedAt: oneHourAgo,
},
},
}, },
{ {
entryID: "entry123", entryID: "entry123",