Move cache age to settings.py

merge-requests/1/head
Pierros Papadeas 2018-12-03 12:02:32 +02:00
parent f14bd43087
commit 05fb4f59f2
No known key found for this signature in database
GPG Key ID: 8DB97129D9982991
2 changed files with 2 additions and 2 deletions

View File

@ -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(

View File

@ -1,2 +1,3 @@
DB_BASE_URL = 'https://db.satnogs.org'
NETWORK_BASE_URL = 'https://network.satnogs.org'
CACHE_AGE = 24