mirror of https://github.com/D4-project/d4-core
fix: [worker4] fix save rotation
parent
797ec0056a
commit
b6c48d95e3
|
@ -4,7 +4,6 @@ import os
|
|||
import sys
|
||||
import time
|
||||
import redis
|
||||
import subprocess
|
||||
|
||||
import datetime
|
||||
|
||||
|
@ -64,8 +63,7 @@ if __name__ == "__main__":
|
|||
date = new_date
|
||||
rotate_file = True
|
||||
|
||||
if rotate_file:
|
||||
if b'\n[' in data[b'message']:
|
||||
if rotate_file and b'\n[' in data[b'message']:
|
||||
old_str, new_str = data[b'message'].split(b'\n[', maxsplit=1)
|
||||
|
||||
with open(rel_path, 'ab') as f:
|
||||
|
@ -95,7 +93,6 @@ if __name__ == "__main__":
|
|||
redis_server.srem('working_session_uuid:{}'.format(type), session_uuid)
|
||||
redis_server.hdel('map-type:session_uuid-uuid:{}'.format(type), session_uuid)
|
||||
redis_server.delete(stream_name)
|
||||
# make sure that tcpdump can save all datas
|
||||
print('dnscap: {} Done'.format(session_uuid))
|
||||
sys.exit(0)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue