This commit is contained in:
shoopea 2020-06-17 11:46:17 +02:00
parent d6d6c05405
commit b11053d491

View File

@ -23,6 +23,7 @@ func startCron() *cron.Cron {
c.AddFunc("59 6,14,22 * * *", cronCheckVaultLimit) c.AddFunc("59 6,14,22 * * *", cronCheckVaultLimit)
c.AddFunc("15 7,15,23 * * *", cronSendWarReport) c.AddFunc("15 7,15,23 * * *", cronSendWarReport)
c.AddFunc("55 6,14,22 * * *", cronAutoDeposit) c.AddFunc("55 6,14,22 * * *", cronAutoDeposit)
c.AddFunc("48 * * * *", cronAutoDeposit)
c.AddFunc("@every 1m", cronSaveClients) c.AddFunc("@every 1m", cronSaveClients)
c.Start() c.Start()
return c return c
@ -169,7 +170,7 @@ func cronAutoDeposit() {
Status: 0, Status: 0,
} }
for _, v := range c.Config.AutoDepositItems { for _, v := range c.Config.AutoDepositItems {
p.ResObjID64 = append(p.ResObjID64, cacheObjItem[v]) p.ResObjID64 = append(p.ResObjID64, getObjItemID(v, ``))
} }
for _, v := range c.Config.AutoDepositTypes { for _, v := range c.Config.AutoDepositTypes {
list := getSQLListID64(fmt.Sprintf("select o.id from obj o where o.obj_sub_type_id = %d;", cacheObjSubType[v])) list := getSQLListID64(fmt.Sprintf("select o.id from obj o where o.obj_sub_type_id = %d;", cacheObjSubType[v]))
@ -177,7 +178,7 @@ func cronAutoDeposit() {
} }
b, _ := json.Marshal(p) b, _ := json.Marshal(p)
t := time.Now().UTC() t := time.Now().UTC()
_, err := createJob(cacheObjSubType[`job_gdeposit`], objJobPriority, int64(c.TGUserID64), 0, t, b) _, err := createJob(cacheObjSubType[`job_gdeposit`], objJobPriority, c.TGUserID64, 0, t, b)
logOnError(err, "cronAutoDeposit : createJob") logOnError(err, "cronAutoDeposit : createJob")
} }
} }