Stop fetching from db on zero lenght db api url
parent
9aa4c35475
commit
b522d4304c
|
@ -11,7 +11,9 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
db_api_url = settings.DB_API_ENDPOINT
|
db_api_url = settings.DB_API_ENDPOINT
|
||||||
|
if len(db_api_url) == 0:
|
||||||
|
self.stdout.write("Zero length api url, fetching is stopped")
|
||||||
|
return
|
||||||
mode_url = '{}modes'.format(db_api_url)
|
mode_url = '{}modes'.format(db_api_url)
|
||||||
satellites_url = "{}satellites".format(db_api_url)
|
satellites_url = "{}satellites".format(db_api_url)
|
||||||
transmitters_url = "{}transmitters".format(db_api_url)
|
transmitters_url = "{}transmitters".format(db_api_url)
|
||||||
|
|
|
@ -49,6 +49,8 @@ def update_all_tle():
|
||||||
def fetch_data():
|
def fetch_data():
|
||||||
"""Task to fetch all data from DB"""
|
"""Task to fetch all data from DB"""
|
||||||
apiurl = settings.DB_API_ENDPOINT
|
apiurl = settings.DB_API_ENDPOINT
|
||||||
|
if len(apiurl) == 0:
|
||||||
|
return
|
||||||
modes_url = "{0}modes".format(apiurl)
|
modes_url = "{0}modes".format(apiurl)
|
||||||
satellites_url = "{0}satellites".format(apiurl)
|
satellites_url = "{0}satellites".format(apiurl)
|
||||||
transmitters_url = "{0}transmitters".format(apiurl)
|
transmitters_url = "{0}transmitters".format(apiurl)
|
||||||
|
|
Loading…
Reference in New Issue