corrigindo upload
This commit is contained in:
1 parent
d2a68fa744
commit
1c37cc4b80
13 files changed
+6848492
-979754
No files matched your search
@@ -28,7 +28,7 @@ from flask_login import (
|
||||
from flask_admin import Admin, AdminIndexView, expose
|
||||
from flask_admin.contrib.sqla import ModelView
|
||||
|
||||
from main import process_single_file, generate_manifests, slugify
|
||||
from main import process_single_file, generate_manifests, slugify, rebuild_all_yamls
|
||||
from utils import (
|
||||
ALLOWED_EXTENSIONS,
|
||||
ALLOWED_SAMPLE_EXTENSIONS,
|
||||
@@ -174,13 +174,16 @@ def allowed_sample(filename):
|
||||
and filename.rsplit(".", 1)[1].lower() in ALLOWED_SAMPLE_EXTENSIONS
|
||||
)
|
||||
|
||||
|
||||
def run_jekyll_build():
|
||||
RUBY_BIN_PATH = "/usr/bin/ruby3.2"
|
||||
BUNDLE_PATH = "/nethome/jotachina/projetos/mmpSearch/vendor/bundle/ruby/3.2.0/bin/bundle"
|
||||
|
||||
BUNDLE_PATH = (
|
||||
"/nethome/jotachina/projetos/mmpSearch/vendor/bundle/ruby/3.2.0/bin/bundle"
|
||||
)
|
||||
|
||||
env_vars = os.environ.copy()
|
||||
env_vars["PATH"] = f"{RUBY_BIN_PATH}:{env_vars.get('PATH', '')}"
|
||||
|
||||
|
||||
command = [
|
||||
BUNDLE_PATH,
|
||||
"exec",
|
||||
@@ -189,7 +192,7 @@ def run_jekyll_build():
|
||||
"--destination",
|
||||
"/var/www/html/trens/mmpSearch/",
|
||||
]
|
||||
|
||||
|
||||
logging.info("⏳ Aguardando liberação para iniciar build do Jekyll...")
|
||||
with JEKYLL_LOCK:
|
||||
logging.info("🔨 Iniciando build do Jekyll (Travando a fila)...")
|
||||
@@ -200,11 +203,13 @@ def run_jekyll_build():
|
||||
env=env_vars,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=True
|
||||
check=True,
|
||||
)
|
||||
logging.info("✅ Jekyll Build concluído com sucesso!")
|
||||
except subprocess.CalledProcessError as e:
|
||||
logging.error(f"❌ ERRO FATAL no Jekyll Build (Code {e.returncode}):\n{e.stderr}")
|
||||
logging.error(
|
||||
f"❌ ERRO FATAL no Jekyll Build (Code {e.returncode}):\n{e.stderr}"
|
||||
)
|
||||
except Exception as e:
|
||||
logging.error(f"❌ Erro inesperado ao chamar Jekyll: {e}")
|
||||
|
||||
@@ -331,11 +336,14 @@ def update_xml_paths_exact(mmp_filename, replacements):
|
||||
print(f"Erro crítico ao editar XML: {e}")
|
||||
return False
|
||||
|
||||
|
||||
def run_heavy_tasks_in_background():
|
||||
logging.info("--- [BACKGROUND] Iniciando tarefas assíncronas ---")
|
||||
try:
|
||||
generate_manifests(SRC_MMPSEARCH)
|
||||
|
||||
# ---> ATUALIZA OS ARQUIVOS "ALL" AQUI <---
|
||||
rebuild_all_yamls()
|
||||
|
||||
run_jekyll_build()
|
||||
logging.info("--- [BACKGROUND] Todas as tarefas concluídas ---")
|
||||
except Exception as e:
|
||||
|
||||
Reference in new issue
Block a user