Skip to content

Commit

Permalink
Make sure sqlite file is created before browsing
Browse files Browse the repository at this point in the history
  • Loading branch information
devl00p committed Jun 22, 2021
1 parent debd1b1 commit ebb1ac1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wapitiCore/main/wapiti.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ def __init__(self, root_url, scope="folder", session_dir=None, config_dir=None):
async def init_persister(self):
await self.persister.create()

@property
def history_file(self):
return self._history_file

def _init_report(self):
self.report_gen = get_report_generator_instance(self.report_generator_type.lower())

Expand Down Expand Up @@ -317,7 +321,6 @@ async def update(self):
print(_("Update done."))

async def load_scan_state(self):
await self.persister.create()
async for resource in self.persister.get_to_browse():
self._start_urls.append(resource)
async for resource in self.persister.get_links():
Expand Down Expand Up @@ -1279,6 +1282,8 @@ async def wapiti_main():
print(msg)
sys.exit(2)

assert os.path.exists(wap.history_file)

loop = asyncio.get_event_loop()

try:
Expand Down

0 comments on commit ebb1ac1

Please sign in to comment.