don't spam

This commit is contained in:
Andre Medeiros 2021-07-05 21:55:01 -04:00
parent f83ce540b1
commit 771e0e221e

View file

@ -103,6 +103,12 @@ func accountWorker(id int, rc *reddit.Client, db *sql.DB, logger *log.Logger, qu
log.Fatal(err) log.Fatal(err)
} }
// If no latest message recorded, we're not going to notify on every message. Remember that and move on.
if account.LastMessageID == "" {
tx.Commit()
continue
}
devices := []string{} devices := []string{}
query = ` query = `
SELECT apns_token FROM devices SELECT apns_token FROM devices