mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
chg: [feeder pystemon] add debug
This commit is contained in:
parent
25420005e7
commit
be3446ff97
1 changed files with 11 additions and 5 deletions
|
@ -57,14 +57,20 @@ topic = '102'
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
time.sleep(base_sleeptime + sleep_inc)
|
time.sleep(base_sleeptime + sleep_inc)
|
||||||
paste = r.lpop("pastes")
|
item_id = r.lpop("pastes")
|
||||||
if paste is None:
|
if item_id is None:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
print(paste)
|
print(item_id)
|
||||||
with open(pystemonpath+paste, 'rb') as f: #.read()
|
full_item_path = os.path.join(pystemonpath, item_id)
|
||||||
|
if not os.path.isfile(full_item_path):
|
||||||
|
print('Error: {}, file not found'.format(full_item_path))
|
||||||
|
sleep_inc = 1
|
||||||
|
continue
|
||||||
|
|
||||||
|
with open(full_item_path, 'rb') as f: #.read()
|
||||||
messagedata = f.read()
|
messagedata = f.read()
|
||||||
path_to_send = os.path.join(pastes_directory,paste)
|
path_to_send = os.path.join(pastes_directory, item_id)
|
||||||
|
|
||||||
s = b' '.join( [ topic.encode(), path_to_send.encode(), base64.b64encode(messagedata) ] )
|
s = b' '.join( [ topic.encode(), path_to_send.encode(), base64.b64encode(messagedata) ] )
|
||||||
socket.send(s)
|
socket.send(s)
|
||||||
|
|
Loading…
Reference in a new issue