This commit is contained in:
shoopea 2019-12-15 15:38:58 +08:00
parent 3023eea74e
commit 4c08a23b73
2 changed files with 3 additions and 3 deletions

2
bot.go
View File

@ -669,7 +669,7 @@ func botGStock(m *tb.Message) {
}
b, _ := json.Marshal(p)
t := time.Now().UTC().Add(1 * time.Second)
_, err := createJob(objSubTypeJobGStock, objJobPriority, userID64, 0, t, b)
_, err = createJob(objSubTypeJobGStock, objJobPriority, userID64, 0, t, b)
if err != nil {
c := TGCommand{

View File

@ -9,7 +9,7 @@ import (
func setClientBusy(userID64 int64, from time.Time, duration time.Duration) error {
if from.UTC().Add(duration).After(time.Now().UTC()) {
if clt, ok := getLockedClient(m.Chat.ID, false); ok {
if clt, ok := getLockedClient(userID64, false); ok {
clt.CWIdle = false
clt.CWBusyUntil = from.UTC().Add(duration)
clt.Mux.Unlock()
@ -22,7 +22,7 @@ func setClientBusy(userID64 int64, from time.Time, duration time.Duration) error
}
func setClientIdle(userID64 int64, from time.Time) error {
if clt, ok := getLockedClient(m.Chat.ID, false); ok {
if clt, ok := getLockedClient(userID64, false); ok {
if from.UTC().After(clt.CWLastUpdate.UTC()) {
clt.CWBusyUntil = from
clt.CWIdle = true