Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Fixed BigScreen not starting when there is no internet connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoronex committed Feb 28, 2020
1 parent 4918cd4 commit f8e5d43
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,11 @@ def get_slide_data(name):

elif name == "Calendar":
if (datetime.now() - last_calendar_update).seconds > app.config['CALENDAR_UPDATE_INTERVAL']:
get_current_calendar()
last_calendar_update = datetime.now()
try:
get_current_calendar()
last_calendar_update = datetime.now()
except URLError:
return {}
now = pytz.utc.localize(datetime.now())

items = []
Expand Down Expand Up @@ -284,10 +287,7 @@ def stop_biertje_kwartiertje():
def get_current_calendar():
global cal
req = urllib.request.Request(app.config['CALENDAR_URL'])
try:
response = urllib.request.urlopen(req)
except URLError:
raise URLError
response = urllib.request.urlopen(req)
cal = Calendar(response.read().decode('iso-8859-1'))


Expand Down

0 comments on commit f8e5d43

Please sign in to comment.