mirror of https://github.com/CIRCL/lookyloo
chg: Properly handle missing HAR
parent
be3bec1252
commit
1157428d88
|
@ -115,6 +115,7 @@ class AsyncCapture(AbstractManager):
|
||||||
with (dirpath / 'error.txt').open('w') as _error:
|
with (dirpath / 'error.txt').open('w') as _error:
|
||||||
json.dump(entries['error'], _error)
|
json.dump(entries['error'], _error)
|
||||||
|
|
||||||
|
if 'har' in entries:
|
||||||
with (dirpath / '0.har').open('w') as _har:
|
with (dirpath / '0.har').open('w') as _har:
|
||||||
json.dump(entries['har'], _har)
|
json.dump(entries['har'], _har)
|
||||||
|
|
||||||
|
@ -133,9 +134,9 @@ class AsyncCapture(AbstractManager):
|
||||||
if 'cookies' in entries and entries['cookies']:
|
if 'cookies' in entries and entries['cookies']:
|
||||||
with (dirpath / '0.cookies.json').open('w') as _cookies:
|
with (dirpath / '0.cookies.json').open('w') as _cookies:
|
||||||
json.dump(entries['cookies'], _cookies)
|
json.dump(entries['cookies'], _cookies)
|
||||||
await self.redis.hset('lookup_dirs', uuid, str(dirpath))
|
|
||||||
|
|
||||||
async with self.redis.pipeline() as lazy_cleanup:
|
async with self.redis.pipeline() as lazy_cleanup:
|
||||||
|
await lazy_cleanup.hset('lookup_dirs', uuid, str(dirpath))
|
||||||
if queue and await self.redis.zscore('queues', queue):
|
if queue and await self.redis.zscore('queues', queue):
|
||||||
await lazy_cleanup.zincrby('queues', -1, queue)
|
await lazy_cleanup.zincrby('queues', -1, queue)
|
||||||
await lazy_cleanup.srem('ongoing', uuid)
|
await lazy_cleanup.srem('ongoing', uuid)
|
||||||
|
|
Loading…
Reference in New Issue