From a58c707dbff1eaab7938985cd0ed2878d7acf55a Mon Sep 17 00:00:00 2001 From: Andy Chosak Date: Thu, 2 Nov 2023 12:59:50 +0000 Subject: [PATCH] Bug fix: don't recreate database if resuming --- crawler/management/commands/crawl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crawler/management/commands/crawl.py b/crawler/management/commands/crawl.py index 6b56390..b473ba4 100644 --- a/crawler/management/commands/crawl.py +++ b/crawler/management/commands/crawl.py @@ -33,7 +33,8 @@ def command(start_url, db_filename, max_pages, depth, recreate, resume): "or --resume to resume a previous crawl." ) - os.remove(db_filename) + if recreate: + os.remove(db_filename) wpull_progress_filename = f"{db_filename}.wpull.db" click.echo(