Monitors an API for new data and sends digest emails to subscribers.
| id | query |
|---|---|
| 3 | status=active |
| id | query | frequency | |
|---|---|---|---|
| 1 | [email protected] | 3 | daily |
| query-id | record-id |
|---|---|
| 3 | 124098 |
Although this wouldn't work if subscribers have different frequencies... Maybe MVP requires all queries be daily? Perhaps we can flush the query-matches cache each run and only fill it with the record-ids of the most recent query.
| id | date-observed |
|---|---|
| 22 | 2016-11--04T12:32Z |
| id | query | last-ran |
|---|---|---|
| 3 | status=active | 2016-11-03T12:23Z |
SELECT id
FROM records-observed
WHERE date-observed < ${query.last-ran}