From d1c62b106d47941c7e35a39a71c9048d41509cc2 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Sat, 17 May 2014 17:17:18 +0300 Subject: [PATCH] Fix: refresh fails if no status was previously set --- redash/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redash/tasks.py b/redash/tasks.py index 5ed5031a..23faecfe 100644 --- a/redash/tasks.py +++ b/redash/tasks.py @@ -131,7 +131,7 @@ def refresh_queries(): 'last_refresh_at': now }) - statsd_client.gauge('manager.seconds_since_refresh', now - float(status['last_refresh_at'])) + statsd_client.gauge('manager.seconds_since_refresh', now - float(status.get('last_refresh_at', now))) @celery.task(bind=True, track_started=True) def execute_query(self, query, data_source_id):