mirror of https://github.com/D4-project/d4-core
chg: [worker 1] add debug
parent
a0857974ba
commit
f371a2e9ac
|
@ -14,7 +14,7 @@ def data_incorrect_format(stream_name, session_uuid, uuid):
|
||||||
redis_server_stream.sadd('Error:IncorrectType', session_uuid)
|
redis_server_stream.sadd('Error:IncorrectType', session_uuid)
|
||||||
redis_server_metadata.hset('metadata_uuid:{}'.format(uuid), 'Error', 'Error: Type={}, Incorrect file format'.format(type))
|
redis_server_metadata.hset('metadata_uuid:{}'.format(uuid), 'Error', 'Error: Type={}, Incorrect file format'.format(type))
|
||||||
clean_stream(stream_name, session_uuid)
|
clean_stream(stream_name, session_uuid)
|
||||||
print('Incorrect format')
|
print('Incorrect format, uuid={}'.format(uuid))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def clean_stream(stream_name, session_uuid):
|
def clean_stream(stream_name, session_uuid):
|
||||||
|
@ -145,6 +145,8 @@ if __name__ == "__main__":
|
||||||
Error_message = process.stderr.read()
|
Error_message = process.stderr.read()
|
||||||
if Error_message == b'tcpdump: unknown file format\n':
|
if Error_message == b'tcpdump: unknown file format\n':
|
||||||
data_incorrect_format(stream_name, session_uuid, uuid)
|
data_incorrect_format(stream_name, session_uuid, uuid)
|
||||||
|
elif Error_message:
|
||||||
|
print(Error_message)
|
||||||
|
|
||||||
#print(process.stdout.read())
|
#print(process.stdout.read())
|
||||||
nb_save += 1
|
nb_save += 1
|
||||||
|
@ -159,7 +161,8 @@ if __name__ == "__main__":
|
||||||
# success, all data are saved
|
# success, all data are saved
|
||||||
if redis_server_stream.sismember('ended_session', session_uuid):
|
if redis_server_stream.sismember('ended_session', session_uuid):
|
||||||
out, err = process.communicate(timeout= 0.5)
|
out, err = process.communicate(timeout= 0.5)
|
||||||
#print(out)
|
#if out:
|
||||||
|
# print(out)
|
||||||
if err == b'tcpdump: unknown file format\n':
|
if err == b'tcpdump: unknown file format\n':
|
||||||
data_incorrect_format(stream_name, session_uuid, uuid)
|
data_incorrect_format(stream_name, session_uuid, uuid)
|
||||||
elif err:
|
elif err:
|
||||||
|
|
Loading…
Reference in New Issue