journalstream: cast all values as string

This commit is contained in:
Christophe Siraut 2020-09-10 15:26:58 +02:00
parent b202828360
commit 8736c1753c
2 changed files with 1 additions and 3 deletions

View File

@ -69,8 +69,6 @@ def get_journal_entries(journal_stream, debug=False):
match = field_pattern.match(line)
if match:
k, v = match.groups()
if v.isdigit():
v = int(v)
store.append((k, v))
else:
multiline_field = multiline_field + line + '\n'

View File

@ -97,7 +97,7 @@ def UploadView(request, debug=False):
for el in chunk:
data = {k: v for k, v in el}
try:
timestamp = datetime.datetime.fromtimestamp(data['__REALTIME_TIMESTAMP'] / 1000000)
timestamp = datetime.datetime.fromtimestamp(int(data['__REALTIME_TIMESTAMP']) / 1000000)
except (KeyError, TypeError, ValueError):
continue
if (now - timestamp).days > settings.JOURNAL_HISTORY: