Adding internal timeout to job pillage
This commit is contained in:
parent
90853271d3
commit
d018453106
1
def.go
1
def.go
@ -215,6 +215,7 @@ type JobPayloadMsgRefresh struct {
|
||||
|
||||
type JobPayloadPillage struct {
|
||||
ObjID64 int64 `json:"obj_id"`
|
||||
Date time.Time `json:"date"`
|
||||
}
|
||||
|
||||
type JobPayloadTribute struct {
|
||||
|
11
job.go
11
job.go
@ -351,6 +351,17 @@ func jobPillage(j Job) {
|
||||
return
|
||||
}
|
||||
|
||||
// is the job outdated now ?
|
||||
if r.Date.Before(time.Now().Sub(3*time.Minute + 30*time.Second)) {
|
||||
s := TGCommand{
|
||||
Type: commandSendMsg,
|
||||
Text: fmt.Sprintf("Pillage interception expired"),
|
||||
ToUserID64: j.UserID64,
|
||||
}
|
||||
TGCmdQueue <- s
|
||||
return
|
||||
}
|
||||
|
||||
s := TGCommand{
|
||||
Type: commandSendMsg,
|
||||
Text: fmt.Sprintf("No outcome for the pillage yet"),
|
||||
|
Loading…
Reference in New Issue
Block a user