Clean up process_loop's structure.
(imported from commit 62e427bf22d56960286b237f54660e74fb2866d8)
This commit is contained in:
parent
a8fc07c745
commit
92496fa90f
|
@ -137,7 +137,14 @@ def process_loop(log):
|
||||||
sleep_time = 0.1
|
sleep_time = 0.1
|
||||||
while True:
|
while True:
|
||||||
notice = zephyr.receive(block=False)
|
notice = zephyr.receive(block=False)
|
||||||
if notice is None:
|
if notice is not None:
|
||||||
|
try:
|
||||||
|
process_notice(notice, log)
|
||||||
|
except:
|
||||||
|
print >>sys.stderr, 'Error relaying zephyr'
|
||||||
|
traceback.print_exc()
|
||||||
|
time.sleep(2)
|
||||||
|
|
||||||
time.sleep(sleep_time)
|
time.sleep(sleep_time)
|
||||||
sleep_count += sleep_time
|
sleep_count += sleep_time
|
||||||
if sleep_count > 15:
|
if sleep_count > 15:
|
||||||
|
@ -147,13 +154,6 @@ def process_loop(log):
|
||||||
update_subscriptions_from_humbug()
|
update_subscriptions_from_humbug()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
|
||||||
process_notice(notice, log)
|
|
||||||
except:
|
|
||||||
print >>sys.stderr, 'Error relaying zephyr'
|
|
||||||
traceback.print_exc()
|
|
||||||
time.sleep(2)
|
|
||||||
|
|
||||||
def process_notice(notice, log):
|
def process_notice(notice, log):
|
||||||
zsig, body = notice.message.split("\x00", 1)
|
zsig, body = notice.message.split("\x00", 1)
|
||||||
is_personal = False
|
is_personal = False
|
||||||
|
|
Loading…
Reference in a new issue