fix caps
This commit is contained in:
parent
395c44c51d
commit
8c6b68d35e
1 changed files with 2 additions and 2 deletions
|
@ -926,13 +926,13 @@ class Logger:
|
||||||
# if there's a need to do more gzip, put that to a function
|
# if there's a need to do more gzip, put that to a function
|
||||||
string = BytesIO()
|
string = BytesIO()
|
||||||
gzip = GzipFile(fileobj=string, mode='w')
|
gzip = GzipFile(fileobj=string, mode='w')
|
||||||
gzip.write(data)
|
gzip.write(data.encode('utf-8'))
|
||||||
gzip.close()
|
gzip.close()
|
||||||
data = string.getvalue()
|
data = string.getvalue()
|
||||||
self.cur.execute('''
|
self.cur.execute('''
|
||||||
INSERT INTO caps_cache ( hash_method, hash, data, last_seen )
|
INSERT INTO caps_cache ( hash_method, hash, data, last_seen )
|
||||||
VALUES (?, ?, ?, ?);
|
VALUES (?, ?, ?, ?);
|
||||||
''', (hash_method, hash_, buffer(data), int(time.time())))
|
''', (hash_method, hash_, memoryview(data), int(time.time())))
|
||||||
# (1) -- note above
|
# (1) -- note above
|
||||||
self._timeout_commit()
|
self._timeout_commit()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue