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:
|
||||
subs.add((sub, '*', '*'))
|
||||
|
||||
try:
|
||||
with open('zephyrs', 'r') as log:
|
||||
for ln in log:
|
||||
zeph = simplejson.loads(ln)
|
||||
print "sending saved message to %s from %s..." % (zeph['class'], zeph['sender'])
|
||||
send_zephyr(zeph)
|
||||
except:
|
||||
print >>sys.stderr, 'Could not load zephyr log'
|
||||
traceback.print_exc()
|
||||
if sys.argv[1:] == ['--resend-log']:
|
||||
try:
|
||||
with open('zephyrs', 'r') as log:
|
||||
for ln in log:
|
||||
zeph = simplejson.loads(ln)
|
||||
print "sending saved message to %s from %s..." % (zeph['class'], zeph['sender'])
|
||||
send_zephyr(zeph)
|
||||
except:
|
||||
print >>sys.stderr, 'Could not load zephyr log'
|
||||
traceback.print_exc()
|
||||
|
||||
with open('zephyrs', 'a') as log:
|
||||
print "Starting receive loop"
|
||||
|
|
Loading…
Reference in New Issue