chore: update worker interface (#592)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2021-07-16 19:26:19 +08:00
committed by GitHub
parent 73ff554b19
commit 41c61f11c4
6 changed files with 30 additions and 22 deletions

View File

@@ -278,7 +278,7 @@ func handleNotification(ctx context.Context, cfg config.ConfYaml, req gorush.Req
notification.AddWaitCount()
}
if err := q.Enqueue(*notification); err != nil {
if err := q.Queue(*notification); err != nil {
markFailedNotification(cfg, notification, "max capacity reached")
}

View File

@@ -47,10 +47,10 @@ func TestMain(m *testing.M) {
}
w = simple.NewWorker(int(cfg.Core.QueueNum))
q = queue.NewQueue(w)
q = queue.NewQueue(w, 4)
q.Start()
defer func() {
q.Stop()
q.Shutdown()
q.Wait()
}()