update
This commit is contained in:
parent
715026fd17
commit
708ff883ef
@ -60,6 +60,7 @@ func setClientBusy(userID64 int64, from time.Time, duration time.Duration) error
|
|||||||
clt.CWIdle = false
|
clt.CWIdle = false
|
||||||
clt.CWBusyUntil = from.UTC().Add(duration)
|
clt.CWBusyUntil = from.UTC().Add(duration)
|
||||||
clt.Mux.Unlock()
|
clt.Mux.Unlock()
|
||||||
|
log.Printf("setClientBusy[%s] : set for %s.\n", clt.Login, duration.String())
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
return errors.New("Client not found.")
|
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 {
|
func setClientIdle(userID64 int64, from time.Time) error {
|
||||||
fmt.Printf("setClientIdle : starting for %d.\n", userID64)
|
|
||||||
if clt, ok := getLockedClient(userID64, false); ok {
|
if clt, ok := getLockedClient(userID64, false); ok {
|
||||||
if from.UTC().After(clt.CWLastUpdate.UTC()) {
|
if from.UTC().After(clt.CWLastUpdate.UTC()) {
|
||||||
fmt.Printf("setClientIdle : updated.\n")
|
fmt.Printf("setClientIdle : updated.\n")
|
||||||
clt.CWBusyUntil = from
|
clt.CWBusyUntil = from
|
||||||
clt.CWIdle = true
|
clt.CWIdle = true
|
||||||
clt.CWLastUpdate = from
|
clt.CWLastUpdate = from
|
||||||
|
log.Printf("setClientIdle[%s] : updated.\n", clt.Login)
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("setClientIdle : not updated.\n")
|
log.Printf("setClientIdle[%s] : not updated.\n", clt.Login)
|
||||||
}
|
}
|
||||||
clt.Mux.Unlock()
|
clt.Mux.Unlock()
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user