X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=blobdiff_plain;f=processor.py;h=cd7a66be92facff8ee4df2fd25474a27519863f8;hp=b94231b85e587f74d818f58e90fe07eebef4860b;hb=b781bb56313255e668fffe45a09ed330a9887c13;hpb=81d6be9c4519622a508b80bca039cef1de137fd3 diff --git a/processor.py b/processor.py index b94231b..cd7a66b 100644 --- a/processor.py +++ b/processor.py @@ -44,15 +44,21 @@ class Processor(threading.Thread): #print "response", response self.dispatcher.request_dispatcher.push_response(session, response) + def close(self): + pass + def run(self): while not self.shared.stopped(): - request, session = self.queue.get(10000000000) + try: + request, session = self.queue.get(True, timeout=1) + except: + continue try: self.process(request, session) except: traceback.print_exc(file=sys.stdout) - print_log("processor terminating") + self.close() class Dispatcher: