From 051db29cb0fd7f5a3536e1143dc6ab306bd182ad Mon Sep 17 00:00:00 2001 From: j Date: Fri, 12 Feb 2016 14:30:59 +0530 Subject: [PATCH] only traceback for unknown errors --- oml/nodes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/oml/nodes.py b/oml/nodes.py index cdb9d9c..b661a5f 100644 --- a/oml/nodes.py +++ b/oml/nodes.py @@ -11,13 +11,13 @@ import urllib.request, urllib.error, urllib.parse from datetime import datetime import os import time +import socket import ox from tornado.ioloop import PeriodicCallback import settings import user.models -from changelog import Changelog from websocket import trigger_event from localnodes import LocalNodes @@ -297,6 +297,9 @@ class Node(Thread): self._opener.addheaders = list(zip(self.headers.keys(), self.headers.values())) try: r = self._opener.open(url, timeout=self.TIMEOUT*5) + except socket.timeout: + logger.debug('timeout %s', url) + return False except: logger.debug('openurl failed %s', url, exc_info=True) return False