diff --git a/job-bot.py b/job-bot.py index c68b3e6..91001a9 100644 --- a/job-bot.py +++ b/job-bot.py @@ -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()