Fix Pro plugins download when license key is active

This commit is contained in:
Théophile Diot 2024-03-05 15:39:34 +00:00
parent 1b3d3dc251
commit d38e6d4c0e
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -98,7 +98,6 @@ def install_plugin(plugin_dir: str, db, preview: bool = True) -> bool:
try:
logger.info("Checking BunkerWeb Pro license key...")
db = Database(logger, sqlalchemy_string=getenv("DATABASE_URI"), pool=False)
db_metadata = db.get_metadata()
current_date = datetime.now()
@ -108,6 +107,8 @@ try:
logger.info("Skipping the check for BunkerWeb Pro license (already checked in the last 10 minutes)")
sys_exit(0)
logger.info("Checking BunkerWeb Pro license key...")
data = {
"integration": get_integration(),
"version": get_version(),
@ -215,7 +216,7 @@ try:
# Install plugins
try:
for plugin_dir in glob(temp_dir.joinpath("*").as_posix()):
for plugin_dir in glob(temp_dir.joinpath(data["version"] if metadata["is_pro"] else "", "*").as_posix()):
try:
if install_plugin(plugin_dir, db, not metadata["is_pro"]):
plugin_nbr += 1