mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
[REFACTOR] Rename utils.py to backup.py and update import statements across the project
This commit is contained in:
parent
9e4c35b1e1
commit
65a611072b
5 changed files with 6 additions and 6 deletions
|
|
@ -21,7 +21,7 @@ from Database import Database # type: ignore
|
|||
from logger import setup_logger # type: ignore
|
||||
from model import Base # type: ignore
|
||||
|
||||
LOGGER = setup_logger("BACKUP", getenv("LOG_LEVEL", "INFO"))
|
||||
LOGGER = setup_logger("BACKUP")
|
||||
|
||||
DB_STRING_RX = re_compile(r"^(?P<database>(mariadb|mysql)(\+pymysql)?|sqlite(\+pysqlite)?|postgresql(\+psycopg)?):/+(?P<path>/[^\s]+)")
|
||||
BACKUP_DIR = Path(getenv("BACKUP_DIRECTORY", "/var/lib/bunkerweb/backups"))
|
||||
|
|
@ -8,7 +8,7 @@ deps_path = join(sep, "usr", "share", "bunkerweb", "core", "backup")
|
|||
if deps_path not in sys_path:
|
||||
sys_path.append(deps_path)
|
||||
|
||||
from utils import BACKUP_DIR, LOGGER
|
||||
from backup import BACKUP_DIR, LOGGER
|
||||
|
||||
try:
|
||||
backups = sorted(BACKUP_DIR.glob("*.zip"), reverse=True)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ deps_path = join(sep, "usr", "share", "bunkerweb", "core", "backup")
|
|||
if deps_path not in sys_path:
|
||||
sys_path.append(deps_path)
|
||||
|
||||
from utils import acquire_db_lock, backup_database, BACKUP_DIR, DB_LOCK_FILE, LOGGER, restore_database
|
||||
from backup import acquire_db_lock, backup_database, BACKUP_DIR, DB_LOCK_FILE, LOGGER, restore_database
|
||||
|
||||
status = 0
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ deps_path = join(sep, "usr", "share", "bunkerweb", "core", "backup")
|
|||
if deps_path not in sys_path:
|
||||
sys_path.append(deps_path)
|
||||
|
||||
from utils import acquire_db_lock, backup_database, BACKUP_DIR, DB_LOCK_FILE, LOGGER, update_cache_file
|
||||
from backup import acquire_db_lock, backup_database, BACKUP_DIR, DB_LOCK_FILE, LOGGER, update_cache_file
|
||||
|
||||
status = 0
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ for deps_path in [join(sep, "usr", "share", "bunkerweb", *paths) for paths in ((
|
|||
from Database import Database # type: ignore
|
||||
from logger import setup_logger # type: ignore
|
||||
from jobs import Job # type: ignore
|
||||
from utils import backup_database, update_cache_file
|
||||
from backup import backup_database, update_cache_file
|
||||
|
||||
LOGGER = setup_logger("BACKUP", getenv("LOG_LEVEL", "INFO"))
|
||||
LOGGER = setup_logger("BACKUP")
|
||||
status = 0
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue