Skip to content
This repository was archived by the owner on Aug 30, 2020. It is now read-only.

Commit fd2816a

Browse files
committed
no check for price in 30min if error occurs
1 parent 79808ef commit fd2816a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gutils/tasks.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ func processEntity(ent *models.Entity) {
5252
log.Printf("URL: %s\nXPATH: %s\nKey: %s", ent.URL, ent.XPATH, key)
5353
subject := fmt.Sprintf("[%s] <%s> Alert: failed to fetch price for reason `%s`!", email.Identity, ent.Name, content)
5454
ent.SendEmail(&subject)
55+
// do not check again after 30 minutes
56+
ent.NextCheck.Add(time.Minute * 30)
5557
return
5658
}
5759
if ent.History == nil {
5860
log.Println("WARN: zero price history.", ent)
59-
ent.History = []models.DataPoint{models.DataPoint{Price: content, Timestamp: time.Now()}}
61+
ent.History = []models.DataPoint{{Price: content, Timestamp: time.Now()}}
6062
return
6163
}
6264

0 commit comments

Comments
 (0)