diff --git a/.github/workflows/test-only.yml b/.github/workflows/test-only.yml index fe88080..93a4dbf 100644 --- a/.github/workflows/test-only.yml +++ b/.github/workflows/test-only.yml @@ -1,7 +1,11 @@ name: ADRFinder Test # Triggers the workflow on push or pull request events -on: [push, pull_request] +on: + push: + pull_request: + schedule: + - cron: '30 04 * * *' jobs: test-build: diff --git a/adrfinder/__init__.py b/adrfinder/__init__.py index dbb5608..15caed3 100644 --- a/adrfinder/__init__.py +++ b/adrfinder/__init__.py @@ -36,7 +36,7 @@ from flask_login import login_required from adrfinder.restaurants import Restaurants -__version__ = '0.2.2' +__version__ = '0.2.3' datastore = None diff --git a/adrfinder/fetch_site_status.py b/adrfinder/fetch_site_status.py index d05e962..04ff11e 100644 --- a/adrfinder/fetch_site_status.py +++ b/adrfinder/fetch_site_status.py @@ -26,12 +26,12 @@ def get_auth_cookie(self): self.connection.request("POST", "/finder/api/v1/authz/public", payload, headers) except Exception as e: print(">> Request failed, Unable to get AUTH cookie: {}".format(e)) - raise SystemExit(e) + raise Exception("Request failed, Unable to get AUTH cookie: {}".format(e)) response = self.connection.getresponse() if response.status != 200: print(">> Request failed, Non-200 received getting AUTH cookie: {}".format(response.status)) - raise SystemExit(response.status) + raise Exception("Request failed, Non-200 received getting AUTH cookie: {}".format(response.status)) response.read() headers['Cookie'] = response.getheader('set-cookie') @@ -60,13 +60,13 @@ def run(self, uuid): self.connection.request("GET", endpoint, headers=self.headers) except Exception as e: print(">> Request failed, Unable to get reservation data: {}".format(e)) - raise SystemExit(e) + raise Exception("Request failed, Unable to get reservation data: {}".format(e)) response = self.connection.getresponse() if response.status != 200: print(">> Request failed, Non-200 received getting reservation data: {}".format(response.status)) print(">> Request url: https://disneyworld.disney.go.com{}".format(endpoint)) - raise SystemExit(response.status) + raise Exception("Request failed, Non-200 received getting reservation data: {}".format(response.status)) data = response.read() json_reservations = json.loads(data.decode("utf-8")) @@ -80,6 +80,6 @@ def run(self, uuid): offer_link = base_link + offer['url'] + base_suffix offers.append({'time': offer['label'], 'url': offer_link}) else: - print(">> Restaurant not found") # Maybe should throw hard error here + raise Exception("Restaurant ID not found in data: {}".format(restaurant)) return available_detected, offers