diff options
-rw-r--r-- | lib/msgstore.go | 4 | ||||
-rw-r--r-- | worker/imap/cache.go | 2 | ||||
-rw-r--r-- | worker/imap/idler.go | 15 | ||||
-rw-r--r-- | worker/imap/observer.go | 6 | ||||
-rw-r--r-- | worker/types/worker.go | 21 |
5 files changed, 3 insertions, 45 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go index 29b3c53c..528ce2fa 100644 --- a/lib/msgstore.go +++ b/lib/msgstore.go @@ -421,9 +421,7 @@ func (store *MessageStore) runThreadBuilder() { } } if store.threadBuilderDebounce != nil { - if store.threadBuilderDebounce.Stop() { - log.Tracef("thread builder debounced") - } + store.threadBuilderDebounce.Stop() } store.threadBuilderDebounce = time.AfterFunc(store.threadBuilderDelay, func() { store.runThreadBuilderNow() diff --git a/worker/imap/cache.go b/worker/imap/cache.go index 449a0d7e..95f9353f 100644 --- a/worker/imap/cache.go +++ b/worker/imap/cache.go @@ -82,7 +82,6 @@ func (w *IMAPWorker) initCacheDb(acct string) { case err != nil: w.worker.Errorf("could not get the cache tag from db") default: - w.worker.Tracef("cache version match") if w.config.cacheMaxAge.Hours() > 0 { go w.cleanCache(p) } @@ -159,7 +158,6 @@ func (w *IMAPWorker) getCachedHeaders(msg *types.FetchMessageHeaders) []uint32 { Refs: parse.MsgIDList(hdr, "references"), Size: ch.Size, } - w.worker.Tracef("located cached header %s.%s", uv, u) w.worker.PostMessage(&types.MessageInfo{ Message: types.RespondTo(msg), Info: mi, diff --git a/worker/imap/idler.go b/worker/imap/idler.go index e58cc6b9..30600764 100644 --- a/worker/imap/idler.go +++ b/worker/imap/idler.go @@ -82,12 +82,10 @@ func (i *idler) Start() { select { case <-i.stop: // debounce idle - i.log("=>(idle) [debounce]") i.done <- nil case <-time.After(i.config.idle_debounce): // enter idle mode i.setIdleing(true) - i.log("=>(idle)") now := time.Now() err := i.client.Idle(i.stop, &client.IdleOptions{ @@ -114,16 +112,11 @@ func (i *idler) Stop() error { close(i.stop) select { case err := <-i.done: - if err == nil { - i.log("<=(idle)") - } else { + if err != nil { i.log("<=(idle) with err: %v", err) } reterr = nil case <-time.After(i.config.idle_timeout): - i.log("idle err (timeout); waiting in background") - - i.log("disconnect done->") i.worker.PostMessage(&types.Done{ Message: types.RespondTo(&types.Disconnect{}), }, nil) @@ -133,10 +126,8 @@ func (i *idler) Stop() error { reterr = errIdleTimeout } case i.isWaiting(): - i.log("not stopped: still idleing/hanging") reterr = errIdleModeHangs default: - i.log("not stopped: client not ready") reterr = nil } return reterr @@ -144,13 +135,10 @@ func (i *idler) Stop() error { func (i *idler) waitOnIdle() { i.setWaiting(true) - i.log("wait for idle in background") go func() { defer log.PanicHandler() err := <-i.done if err == nil { - i.log("<=(idle) waited") - i.log("connect done->") i.worker.PostMessage(&types.Done{ Message: types.RespondTo(&types.Connect{}), }, nil) @@ -159,7 +147,6 @@ func (i *idler) waitOnIdle() { } i.setWaiting(false) i.stop = make(chan struct{}) - i.log("restart") i.Start() }() } diff --git a/worker/imap/observer.go b/worker/imap/observer.go index 8bc07c93..1c481bed 100644 --- a/worker/imap/observer.go +++ b/worker/imap/observer.go @@ -66,7 +66,6 @@ func (o *observer) IsRunning() bool { func (o *observer) Start() { if o.running { - o.log("runs already") return } if o.client == nil { @@ -79,14 +78,13 @@ func (o *observer) Start() { defer log.PanicHandler() select { case <-o.client.LoggedOut(): - o.log("<-logout") if o.autoReconnect { o.emit("logged out") } else { o.log("ignore logout (auto-reconnect off)") } case <-o.done: - o.log("<-done") + break } o.running = false o.log("stopped") @@ -140,11 +138,9 @@ func (o *observer) DelayedReconnect() error { } func (o *observer) emit(errMsg string) { - o.log("disconnect done->") o.worker.PostMessage(&types.Done{ Message: types.RespondTo(&types.Disconnect{}), }, nil) - o.log("connection error->") o.worker.PostMessage(&types.ConnError{ Error: fmt.Errorf(errMsg), }, nil) diff --git a/worker/types/worker.go b/worker/types/worker.go index c2fad1ba..cc398da4 100644 --- a/worker/types/worker.go +++ b/worker/types/worker.go @@ -86,12 +86,6 @@ func (worker *Worker) processQueue() { // from the same goroutine that the worker runs in or deadlocks may occur func (worker *Worker) PostAction(msg WorkerMessage, cb func(msg WorkerMessage)) { worker.setId(msg) - - if resp := msg.InResponseTo(); resp != nil { - worker.Tracef("PostAction %T:%T", msg, resp) - } else { - worker.Tracef("PostAction %T", msg) - } // write to Actions channel without blocking worker.queue(msg) @@ -112,11 +106,6 @@ func (worker *Worker) PostMessage(msg WorkerMessage, worker.setId(msg) msg.setAccount(worker.Name) - if resp := msg.InResponseTo(); resp != nil { - worker.Tracef("PostMessage %T:%T", msg, resp) - } else { - worker.Tracef("PostMessage %T", msg) - } WorkerMessages <- msg if cb != nil { @@ -127,11 +116,6 @@ func (worker *Worker) PostMessage(msg WorkerMessage, } func (worker *Worker) ProcessMessage(msg WorkerMessage) WorkerMessage { - if resp := msg.InResponseTo(); resp != nil { - worker.Tracef("ProcessMessage %T(%d):%T(%d)", msg, msg.getId(), resp, resp.getId()) - } else { - worker.Tracef("ProcessMessage %T(%d)", msg, msg.getId()) - } if inResponseTo := msg.InResponseTo(); inResponseTo != nil { worker.Lock() f, ok := worker.actionCallbacks[inResponseTo.getId()] @@ -149,11 +133,6 @@ func (worker *Worker) ProcessMessage(msg WorkerMessage) WorkerMessage { } func (worker *Worker) ProcessAction(msg WorkerMessage) WorkerMessage { - if resp := msg.InResponseTo(); resp != nil { - worker.Tracef("ProcessAction %T(%d):%T(%d)", msg, msg.getId(), resp, resp.getId()) - } else { - worker.Tracef("ProcessAction %T(%d)", msg, msg.getId()) - } if inResponseTo := msg.InResponseTo(); inResponseTo != nil { worker.Lock() f, ok := worker.messageCallbacks[inResponseTo.getId()] |