fix: [server UI v0.2] max len(analyser_sample)

pull/8/head
Terrtia 2019-02-12 09:48:23 +01:00
parent 08809cf574
commit e9ca36f525
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 4 additions and 0 deletions

View File

@ -580,10 +580,14 @@ def whois_data():
def get_analyser_sample():
type = request.args.get('type')
analyzer_uuid = request.args.get('analyzer_uuid')
max_line_len = 3000
if is_valid_uuid_v4(analyzer_uuid):
list_queue = redis_server_analyzer.lrange('analyzer:{}:{}'.format(type, analyzer_uuid), 0 ,10)
list_queue_res = []
for res in list_queue:
#limit line len
if len(res) > max_line_len:
res = res[:1000]
list_queue_res.append('{}\n'.format(res))
return jsonify(''.join(list_queue_res))
else: