mirror of https://github.com/D4-project/d4-core
Merge branch 'master' of https://github.com/D4-project/d4-core
commit
1b3d73e287
server/workers/workers_2/meta_types_modules
|
@ -12,7 +12,7 @@ import datetime
|
|||
DEFAULT_FILE_EXTENSION = 'txt'
|
||||
DEFAULT_FILE_SEPARATOR = b'\n'
|
||||
ROTATION_SAVE_CYCLE = 300 # seconds
|
||||
MAX_BUFFER_LENGTH = 10000
|
||||
MAX_BUFFER_LENGTH = 100000
|
||||
TYPE = 254
|
||||
|
||||
class MetaTypesDefault:
|
||||
|
@ -108,7 +108,7 @@ class MetaTypesDefault:
|
|||
|
||||
def reconstruct_data(self, data):
|
||||
# add buffer to data
|
||||
if not is_empty_buffer():
|
||||
if not self.is_empty_buffer():
|
||||
self.add_to_buffer(data)
|
||||
data = self.get_buffer()
|
||||
|
||||
|
@ -116,7 +116,7 @@ class MetaTypesDefault:
|
|||
if self.get_file_separator() in data:
|
||||
# empty buffer
|
||||
self.reset_buffer()
|
||||
all_reconstructed_data = data.split(self.file_separator())
|
||||
all_line = data.split(self.get_file_separator())
|
||||
for reconstructed_data in all_line[:-1]:
|
||||
self.handle_reconstructed_data(reconstructed_data)
|
||||
|
||||
|
|
|
@ -14,5 +14,11 @@ class TypeHandler(MetaTypesDefault):
|
|||
super().__init__(uuid, json_file)
|
||||
print('init_spec')
|
||||
|
||||
def process_data(self, data):
|
||||
self.reconstruct_data(data)
|
||||
|
||||
def handle_reconstructed_data(self, data):
|
||||
print(data)
|
||||
|
||||
def test(self):
|
||||
print('Class: ja3-jl')
|
||||
|
|
Loading…
Reference in New Issue