mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Add more logs when an url file is in cache and gets deleted
This commit is contained in:
parent
2737fe7ce2
commit
13be6a43c9
4 changed files with 12 additions and 4 deletions
|
|
@ -122,8 +122,10 @@ try:
|
|||
logger.info(
|
||||
f"Blacklist for {kind} is already in cache, skipping downloads...",
|
||||
)
|
||||
|
||||
if not urls[kind]:
|
||||
logger.warning(
|
||||
f"Blacklist for {kind} is cached but no URL is configured, removing from cache...",
|
||||
)
|
||||
blacklist_path.joinpath(f"{kind}.list").unlink(missing_ok=True)
|
||||
deleted, err = del_file_in_db(f"{kind}.list", db)
|
||||
if not deleted:
|
||||
|
|
|
|||
|
|
@ -106,12 +106,15 @@ try:
|
|||
logger.info(
|
||||
f"Greylist for {kind} is already in cache, skipping downloads...",
|
||||
)
|
||||
|
||||
if not urls[kind]:
|
||||
logger.warning(
|
||||
f"Greylist for {kind} is cached but no URL is configured, removing from cache...",
|
||||
)
|
||||
greylist_path.joinpath(f"{kind}.list").unlink(missing_ok=True)
|
||||
deleted, err = del_file_in_db(f"{kind}.list", db)
|
||||
if not deleted:
|
||||
logger.warning(f"Couldn't delete {kind}.list from cache : {err}")
|
||||
|
||||
if all_fresh:
|
||||
_exit(0)
|
||||
|
||||
|
|
|
|||
|
|
@ -77,12 +77,13 @@ try:
|
|||
|
||||
# Don't go further if the cache is fresh
|
||||
if is_cached_file(realip_path.joinpath("combined.list"), "hour", db):
|
||||
logger.info("RealIP list is already in cache, skipping download...")
|
||||
if not urls:
|
||||
logger.warning("No URL found, deleting combined.list from cache...")
|
||||
tmp_realip_path.joinpath("combined.list").unlink(missing_ok=True)
|
||||
deleted, err = del_file_in_db("combined.list", db)
|
||||
if not deleted:
|
||||
logger.warning(f"Couldn't delete combined.list from cache : {err}")
|
||||
logger.info("RealIP list is already in cache, skipping download...")
|
||||
_exit(0)
|
||||
|
||||
# Download and write data to temp file
|
||||
|
|
|
|||
|
|
@ -106,8 +106,10 @@ try:
|
|||
logger.info(
|
||||
f"Whitelist for {kind} is already in cache, skipping downloads...",
|
||||
)
|
||||
|
||||
if not urls[kind]:
|
||||
logger.info(
|
||||
f"Whitelist for {kind} is already in cache, skipping downloads...",
|
||||
)
|
||||
whitelist_path.joinpath(f"{kind}.list").unlink(missing_ok=True)
|
||||
deleted, err = del_file_in_db(f"{kind}.list", db)
|
||||
if not deleted:
|
||||
|
|
|
|||
Loading…
Reference in a new issue