test
This commit is contained in:
parent
3d963439ae
commit
7f2fb9936e
4
cron.go
4
cron.go
@ -22,8 +22,7 @@ func startCron() *cron.Cron {
|
||||
c.AddFunc("13 3,7,11,15,19,23 * * *", cronTribute)
|
||||
c.AddFunc("59 6,14,22 * * *", cronCheckVaultLimit)
|
||||
c.AddFunc("15 7,15,23 * * *", cronSendWarReport)
|
||||
c.AddFunc("55 6,14,22 * * *", cronAutoDeposit)
|
||||
c.AddFunc("54 * * * *", cronAutoDeposit)
|
||||
c.AddFunc("53 6,14,22 * * *", cronAutoDeposit)
|
||||
c.AddFunc("@every 1m", cronSaveClients)
|
||||
c.Start()
|
||||
return c
|
||||
@ -178,6 +177,7 @@ func cronAutoDeposit() {
|
||||
}
|
||||
b, _ := json.Marshal(p)
|
||||
t := time.Now().UTC()
|
||||
t.Add(time.Duration(RndIntn(300)))
|
||||
_, err := createJob(cacheObjSubType[`job_gdeposit`], objJobPriority, c.TGUserID64, 0, t, b)
|
||||
logOnError(err, "cronAutoDeposit : createJob")
|
||||
}
|
||||
|
7
utils.go
7
utils.go
@ -109,6 +109,13 @@ func RndInt64() int64 {
|
||||
return i
|
||||
}
|
||||
|
||||
func RndIntn(n int) int {
|
||||
RndMux.Lock()
|
||||
i := RndSrc.Intn(n)
|
||||
RndMux.Unlock()
|
||||
return i
|
||||
}
|
||||
|
||||
func hammerTimeNow(time string, weather string) bool {
|
||||
if time == `🌞Morning` && weather == `🌧` ||
|
||||
time == `🌙Evening` && weather == `🌤` ||
|
||||
|
Loading…
Reference in New Issue
Block a user