From 60132f3208ff5af7ee39db2b241d51255bf78f5e Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Wed, 27 Nov 2019 06:21:57 -0800 Subject: [PATCH] Minor cleanup --- poller.go | 2 +- processor.go | 8 ++++---- retry.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/poller.go b/poller.go index 046dc5b..027124f 100644 --- a/poller.go +++ b/poller.go @@ -54,7 +54,7 @@ func (p *poller) start() { func (p *poller) exec() { for _, zset := range p.zsets { if err := p.rdb.forward(zset); err != nil { - log.Printf("[ERROR] could not forward scheduled tasks from %q: %v", zset, err) + log.Printf("[ERROR] could not forward scheduled tasks from %q: %v\n", zset, err) } } } diff --git a/processor.go b/processor.go index 8459f7f..bcfc161 100644 --- a/processor.go +++ b/processor.go @@ -72,10 +72,10 @@ func (p *processor) exec() { // timed out, this is a normal behavior. return case errDeserializeTask: - log.Println("[Servere Error] could not parse json encoded message") + log.Println("[Error] could not parse json encoded message") return default: - log.Printf("[Servere Error] unexpected error while pulling message out of queues: %v\n", err) + log.Printf("[Error] unexpected error while pulling message out of queues: %v\n", err) return } } @@ -85,7 +85,7 @@ func (p *processor) exec() { go func(task *Task) { defer func() { if err := p.rdb.lrem(inProgress, msg); err != nil { - log.Printf("[SERVER ERROR] LREM failed: %v\n", err) + log.Printf("[ERROR] could not remove %+v from %q: %v\n", msg, inProgress, err) } <-p.sema // release token }() @@ -101,6 +101,6 @@ func (p *processor) exec() { func (p *processor) restore() { err := p.rdb.moveAll(inProgress, defaultQueue) if err != nil { - log.Printf("[SERVER ERROR] could not move tasks from %q to %q\n", inProgress, defaultQueue) + log.Printf("[ERROR] could not move tasks from %q to %q\n", inProgress, defaultQueue) } } diff --git a/retry.go b/retry.go index fb949ed..4319b1d 100644 --- a/retry.go +++ b/retry.go @@ -12,7 +12,7 @@ func retryTask(rdb *rdb, msg *taskMessage, err error) { if msg.Retried >= msg.Retry { fmt.Println("[DEBUG] Retry exhausted!!!") if err := rdb.kill(msg); err != nil { - log.Printf("[SERVER ERROR] could not add task %+v to 'dead' set\n", err) + log.Printf("[ERROR] could not add task %+v to 'dead' set\n", err) } return } @@ -22,7 +22,7 @@ func retryTask(rdb *rdb, msg *taskMessage, err error) { msg.ErrorMsg = err.Error() if err := rdb.zadd(retry, float64(retryAt.Unix()), msg); err != nil { // TODO(hibiken): Not sure how to handle this error - log.Printf("[SEVERE ERROR] could not add msg %+v to 'retry' set: %v\n", msg, err) + log.Printf("[ERROR] could not add msg %+v to 'retry' set: %v\n", msg, err) return } }