fixed some debug stuff

This commit is contained in:
Jason 2025-05-20 14:43:42 -07:00
parent 3f7360a5b1
commit 862a0efd37

View File

@ -49,7 +49,7 @@ with DAG(
logger.info("Fetching data from job-bot API...")
# # Check if cache file exists and is recent
if os.path.exists(cache_file):
if DEBUG and os.path.exists(cache_file):
cache_age = datetime.now() - datetime.fromtimestamp(os.path.getmtime(cache_file))
#if cache_age < timedelta(hours=1):
print("Using cached API response.")
@ -68,7 +68,8 @@ with DAG(
api_results = response.json()
with open(cache_file, 'w') as f:
json.dump(api_results, f)
logger.info(f"API returned {len(api_results.get('jobs', []))} jobs")
return api_results
@task()