test timeout

This commit is contained in:
shoopea 2019-08-29 18:49:01 +08:00
parent 4b71435b88
commit e60dfdc66f
2 changed files with 5 additions and 3 deletions

2
def.go
View File

@ -9,7 +9,7 @@ import (
tb "gopkg.in/tucnak/telebot.v2" tb "gopkg.in/tucnak/telebot.v2"
) )
const maxUnixTimestamp int64 = 4102444799 const maxUnixTimestamp int64 = 2147483647
type DataBackup struct { type DataBackup struct {
Messages []ChatWarsMessage `json:"messages"` Messages []ChatWarsMessage `json:"messages"`

6
job.go
View File

@ -45,9 +45,11 @@ func createJob(jobTypeID int32, priority int32, userID64 int64, trigger int64, s
} }
defer stmt.Close() defer stmt.Close()
log.Printf("createJob : timeout : %s.\n", time.Unix(maxUnixTimestamp, 0).UTC().Format(time.RFC3339)) t := time.Unix(maxUnixTimestamp, 0).UTC()
_, err = stmt.Exec(objId, priority, userID64, trigger, schedule.UTC(), time.Now().UTC(), time.Unix(maxUnixTimestamp, 0).UTC(), payload) log.Printf("createJob : timeout : %s.\n", t.Format(time.RFC3339))
_, err = stmt.Exec(objId, priority, userID64, trigger, schedule.UTC(), time.Now().UTC(), t, payload)
logOnError(err, "createJob : insert obj_job") logOnError(err, "createJob : insert obj_job")
if err != nil { if err != nil {
return 0, err return 0, err