mirror of https://github.com/zulip/zulip.git
zephyr_mirror: Only resend old messages when invoked with --resend-log
(imported from commit e5a7c8d5b920d796ebbf68efc2beca6b14036695)
This commit is contained in:
parent
028bb9aa8d
commit
1c64ce8bfc
|
@ -53,15 +53,16 @@ if __name__ == '__main__':
|
||||||
for sub in subs_list:
|
for sub in subs_list:
|
||||||
subs.add((sub, '*', '*'))
|
subs.add((sub, '*', '*'))
|
||||||
|
|
||||||
try:
|
if sys.argv[1:] == ['--resend-log']:
|
||||||
with open('zephyrs', 'r') as log:
|
try:
|
||||||
for ln in log:
|
with open('zephyrs', 'r') as log:
|
||||||
zeph = simplejson.loads(ln)
|
for ln in log:
|
||||||
print "sending saved message to %s from %s..." % (zeph['class'], zeph['sender'])
|
zeph = simplejson.loads(ln)
|
||||||
send_zephyr(zeph)
|
print "sending saved message to %s from %s..." % (zeph['class'], zeph['sender'])
|
||||||
except:
|
send_zephyr(zeph)
|
||||||
print >>sys.stderr, 'Could not load zephyr log'
|
except:
|
||||||
traceback.print_exc()
|
print >>sys.stderr, 'Could not load zephyr log'
|
||||||
|
traceback.print_exc()
|
||||||
|
|
||||||
with open('zephyrs', 'a') as log:
|
with open('zephyrs', 'a') as log:
|
||||||
print "Starting receive loop"
|
print "Starting receive loop"
|
||||||
|
|
Loading…
Reference in New Issue