diff --git a/redash/models.py b/redash/models.py index 3d0cc01464..fbe61d6ce2 100644 --- a/redash/models.py +++ b/redash/models.py @@ -806,9 +806,9 @@ def store_result(cls, org, data_source, query_hash, query, data, run_time, retri for q in queries: q.latest_query_data = query_result q.skip_updated_at = True - db.session.add(q) if q.schedule_resultset_size > 0: q.query_results.append(query_result) + db.session.add(q) query_ids = [q.id for q in queries] logging.info("Updated %s queries with result (%s).", len(query_ids), query_hash)