mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
Prevent the loss of the 1 message in import_dir.py
This commit is contained in:
parent
7c88e7d013
commit
9558aafe67
2 changed files with 3 additions and 2 deletions
|
@ -18,10 +18,11 @@ if __name__ == "__main__":
|
||||||
context = zmq.Context()
|
context = zmq.Context()
|
||||||
socket = context.socket(zmq.PUB)
|
socket = context.socket(zmq.PUB)
|
||||||
socket.bind("tcp://*:{}".format(args.port))
|
socket.bind("tcp://*:{}".format(args.port))
|
||||||
|
time.sleep(1) #Important, avoid loosing the 1 message
|
||||||
|
|
||||||
for dirname, dirnames, filenames in os.walk(args.directory):
|
for dirname, dirnames, filenames in os.walk(args.directory):
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
messagedata = open(os.path.join(dirname, filename)).read()
|
messagedata = open(os.path.join(dirname, filename)).read()
|
||||||
print(os.path.join(dirname, filename))
|
print(os.path.join(dirname, filename))
|
||||||
socket.send('{} {} {}'.format(args.channel, filename, base64.b64encode(messagedata)))
|
socket.send('{} {} {}'.format(args.channel, filename, base64.b64encode(messagedata)))
|
||||||
time.sleep(.1)
|
time.sleep(.2)
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id='page-myNewModule'><a href="{{ url_for('myNewModule.myNewModule_page') }}"><i class="glyphicon glyphicon-new-window"></i> myNewModule page</a></li>
|
<li id='page-thisisatest'><a href="{{ url_for('thisisatest.thisisatest_page') }}"><i class="glyphicon glyphicon-new-window"></i> thisisatest </a></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue