Skip to content

Commit

Permalink
More resilience against failure; DMOJ#227
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum5 committed Nov 27, 2016
1 parent 9175a09 commit 457dd07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dmoj/monitor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import traceback
from contextlib import closing
from threading import Thread, Event
from urllib2 import urlopen
Expand Down Expand Up @@ -36,8 +37,11 @@ def run(self):
if self._terminate:
break
for url in self.urls:
with closing(urlopen(url, data='')) as f:
f.read()
try:
with closing(urlopen(url, data='')) as f:
f.read()
except Exception:
traceback.print_exc()


class SendProblemsHandler(FileSystemEventHandler):
Expand Down

0 comments on commit 457dd07

Please sign in to comment.