From 05fb4f59f28ca772e98acb27b779e11f49e4c592 Mon Sep 17 00:00:00 2001 From: Pierros Papadeas Date: Mon, 3 Dec 2018 12:02:32 +0200 Subject: [PATCH] Move cache age to settings.py --- schedule_single_station.py | 3 +-- settings.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/schedule_single_station.py b/schedule_single_station.py index 780b724..f649826 100755 --- a/schedule_single_station.py +++ b/schedule_single_station.py @@ -110,7 +110,6 @@ if __name__ == "__main__": # Settings ground_station_id = args.station length_hours = args.duration - data_age_hours = 24 cache_dir = "/tmp/cache" username = args.username password = args.password @@ -137,7 +136,7 @@ if __name__ == "__main__": # Update logic update = False - if tlast is None or (tnow - tlast).total_seconds() > data_age_hours * 3600: + if tlast is None or (tnow - tlast).total_seconds() > settings.CACHE_AGE * 3600: update = True if not os.path.isfile( os.path.join( diff --git a/settings.py b/settings.py index 5491cef..7ccb2ee 100644 --- a/settings.py +++ b/settings.py @@ -1,2 +1,3 @@ DB_BASE_URL = 'https://db.satnogs.org' NETWORK_BASE_URL = 'https://network.satnogs.org' +CACHE_AGE = 24