From 6750ee98e93b3b3e02872e3633f77149c5ad1a45 Mon Sep 17 00:00:00 2001 From: Karl Date: Fri, 5 Sep 2025 14:31:37 +0100 Subject: [PATCH] try fix cache issue --- lib/reqs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/reqs.py b/lib/reqs.py index aef5d48..cd687f3 100644 --- a/lib/reqs.py +++ b/lib/reqs.py @@ -2,6 +2,7 @@ import requests import json from datetime import datetime from typing import List, Dict, Any, Optional +import time # Create a session object to reuse TCP connections session = requests.Session() @@ -40,13 +41,16 @@ def _make_api_request( def get_urls(base_url: str, auth: str) -> List[Dict[str, Any]]: """Retrieves user account streams from the API.""" - response = _make_api_request("GET", base_url, auth, "getUserAccounts/streams") + endpoint = f"getUserAccounts/streams?_t={int(time.time())}" + response = _make_api_request("GET", base_url, auth, endpoint) return response.json() if response else [] def get_user_accounts(base_url: str, auth: str) -> List[Dict[str, Any]]: """Retrieves user accounts from the API.""" - response = _make_api_request("GET", base_url, auth, "getUserAccounts") + # Add cache-busting parameter to ensure fresh data + endpoint = f"getUserAccounts?_t={int(time.time())}" + response = _make_api_request("GET", base_url, auth, endpoint) if not response: return []