mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Handling missing values
This commit is contained in:
parent
c9c891e44a
commit
238aa3916a
1 changed files with 5 additions and 3 deletions
|
@ -20,6 +20,7 @@ def main():
|
|||
failed = False
|
||||
feeds_fetched = 0
|
||||
FETCHES_DROP_AMOUNT = 0
|
||||
redis_task_fetches = 0
|
||||
monitor_key = "Monitor:task_fetches"
|
||||
r = redis.Redis(connection_pool=settings.REDIS_ANALYTICS_POOL)
|
||||
|
||||
|
@ -34,9 +35,6 @@ def main():
|
|||
failed = True
|
||||
|
||||
if failed:
|
||||
r.set(monitor_key, feeds_fetched)
|
||||
r.expire(monitor_key, 60*60*3) # 3 hours
|
||||
|
||||
requests.post(
|
||||
"https://api.mailgun.net/v2/%s/messages" % settings.MAILGUN_SERVER_NAME,
|
||||
auth=("api", settings.MAILGUN_ACCESS_KEY),
|
||||
|
@ -44,6 +42,10 @@ def main():
|
|||
"to": [admin_email],
|
||||
"subject": "%s feeds fetched falling: %s" % (hostname, feeds_fetched),
|
||||
"text": "Feed fetches are falling: %s" % (feeds_fetched)})
|
||||
|
||||
r.set(monitor_key, feeds_fetched)
|
||||
r.expire(monitor_key, 60*60*3) # 3 hours
|
||||
|
||||
print(" ---> Feeds fetched falling! %s" % (feeds_fetched))
|
||||
else:
|
||||
print(" ---> Feeds fetched OK: %s" % (feeds_fetched))
|
||||
|
|
Loading…
Add table
Reference in a new issue