From 708ff883ef99a3d72b3e3ac0ea8277ee8dd5b346 Mon Sep 17 00:00:00 2001 From: shoopea Date: Tue, 14 Jan 2020 14:47:23 +0800 Subject: [PATCH] update --- client.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 6974a0e..a114bd3 100644 --- a/client.go +++ b/client.go @@ -60,6 +60,7 @@ func setClientBusy(userID64 int64, from time.Time, duration time.Duration) error clt.CWIdle = false clt.CWBusyUntil = from.UTC().Add(duration) clt.Mux.Unlock() + log.Printf("setClientBusy[%s] : set for %s.\n", clt.Login, duration.String()) return nil } else { return errors.New("Client not found.") @@ -69,15 +70,15 @@ func setClientBusy(userID64 int64, from time.Time, duration time.Duration) error } func setClientIdle(userID64 int64, from time.Time) error { - fmt.Printf("setClientIdle : starting for %d.\n", userID64) if clt, ok := getLockedClient(userID64, false); ok { if from.UTC().After(clt.CWLastUpdate.UTC()) { fmt.Printf("setClientIdle : updated.\n") clt.CWBusyUntil = from clt.CWIdle = true clt.CWLastUpdate = from + log.Printf("setClientIdle[%s] : updated.\n", clt.Login) } else { - fmt.Printf("setClientIdle : not updated.\n") + log.Printf("setClientIdle[%s] : not updated.\n", clt.Login) } clt.Mux.Unlock() return nil