Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
justinh-rahb authored Oct 11, 2023
1 parent 1f28a7d commit 119c4ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def refresh_and_fetch_csv(query_id):
# Check the response status code
if response.status_code == 200:
print(f"Query {query_id} refreshed successfully.")

# Introduce a 5-second delay before fetching the CSV
time.sleep(5)

# Construct the CSV URL and fetch the CSV data
csv_url = f"{settings.redash_url}/api/queries/{query_id}/results.csv?api_key={settings.api_key}"
Expand Down Expand Up @@ -130,4 +133,4 @@ def main():
time.sleep(1)

if __name__ == '__main__':
main()
main()

0 comments on commit 119c4ab

Please sign in to comment.