test
This commit is contained in:
parent
8bf6e0b7ab
commit
3a45e3f595
2
items.go
2
items.go
@ -5,7 +5,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func reloadObjItem(code string, name string, itemTypeID64 int64, weight int) {
|
func reloadObjItem(code string, name string, itemTypeID64 int64, weight int) {
|
||||||
id := getObjItemID(code, name)
|
id := silentGetObjItemID(code, name)
|
||||||
if id == 0 {
|
if id == 0 {
|
||||||
_, err := addObjItem(code, name, itemTypeID64, weight)
|
_, err := addObjItem(code, name, itemTypeID64, weight)
|
||||||
logOnError(err, "reloadObjItem : addObjItem")
|
logOnError(err, "reloadObjItem : addObjItem")
|
||||||
|
21
obj.go
21
obj.go
@ -500,18 +500,23 @@ func addObjItem(code string, name string, itemTypeID64 int64, weight int) (int64
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getObjItemID(c string, n string) int64 {
|
func getObjItemID(c string, n string) int64 {
|
||||||
|
i := silentGetObjItemID(c, n)
|
||||||
|
if i == 0 {
|
||||||
|
w := TGCommand{
|
||||||
|
Type: commandSendMsg,
|
||||||
|
Text: fmt.Sprintf("Object unknown : %s - %s\n", c, n),
|
||||||
|
ToUserID64: cfg.Bot.Admin,
|
||||||
|
}
|
||||||
|
TGCmdQueue <- w
|
||||||
|
}
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
|
||||||
|
func silentGetObjItemID(c string, n string) int64 {
|
||||||
if v, ok := cacheObjItem.Load(c); ok {
|
if v, ok := cacheObjItem.Load(c); ok {
|
||||||
i := v.(ChatWarsItem)
|
i := v.(ChatWarsItem)
|
||||||
return i.ObjID64
|
return i.ObjID64
|
||||||
} else {
|
} else {
|
||||||
/*
|
|
||||||
w := TGCommand{
|
|
||||||
Type: commandSendMsg,
|
|
||||||
Text: fmt.Sprintf("Object unknown : %s - %s\n", c, n),
|
|
||||||
ToUserID64: cfg.Bot.Admin,
|
|
||||||
}
|
|
||||||
TGCmdQueue <- w
|
|
||||||
*/
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,8 +220,6 @@ func SQLJobWorker() {
|
|||||||
}
|
}
|
||||||
if len(jobs) < SQLJobSliceSize {
|
if len(jobs) < SQLJobSliceSize {
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
} else {
|
|
||||||
time.Sleep(1 * time.Millisecond)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Printf("SQLJobWorker : Closing.")
|
log.Printf("SQLJobWorker : Closing.")
|
||||||
|
Loading…
Reference in New Issue
Block a user