SIENTIAPDE-1579: Lint fixes and formatting
This commit is contained in:
@@ -14,18 +14,18 @@ import asyncio
|
||||
import os
|
||||
import sys
|
||||
from datetime import timedelta
|
||||
from typing import Any
|
||||
from dotenv import load_dotenv
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from temporalio.client import Client
|
||||
|
||||
# Ensure project root is on PYTHONPATH when running directly
|
||||
# Ensure project root is on PYTHONPATH when running directly (must run before model_manager import)
|
||||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
if ROOT_DIR not in sys.path:
|
||||
sys.path.insert(0, ROOT_DIR)
|
||||
|
||||
from model_manager.workflows.cleanup_files import CleanupFiles
|
||||
|
||||
from model_manager.workflows.cleanup_files import CleanupFiles # noqa: E402
|
||||
|
||||
# Carrega variáveis de ambiente do arquivo .env na raiz do projeto
|
||||
PROJECT_ROOT = Path(__file__).resolve().parent.parent
|
||||
@@ -53,7 +53,7 @@ async def main(argv: list[str]) -> None:
|
||||
if argv:
|
||||
bucket_name = argv[0]
|
||||
|
||||
print(f"Connecting to Temporal at {temporal_host} (namespace={temporal_namespace})...")
|
||||
print(f'Connecting to Temporal at {temporal_host} (namespace={temporal_namespace})...')
|
||||
client = await Client.connect(
|
||||
target_host=temporal_host,
|
||||
namespace=temporal_namespace,
|
||||
@@ -64,12 +64,14 @@ async def main(argv: list[str]) -> None:
|
||||
'bucket_name': bucket_name,
|
||||
}
|
||||
|
||||
workflow_id = f"cleanup-files-manual-{int(asyncio.get_event_loop().time())}"
|
||||
workflow_id = f'cleanup-files-manual-{int(asyncio.get_event_loop().time())}'
|
||||
|
||||
print(f"Starting cleanup_files workflow once...\n"
|
||||
f" workflow_id = {workflow_id}\n"
|
||||
f" task_queue = {task_queue}\n"
|
||||
f" bucket_name = {bucket_name}")
|
||||
print(
|
||||
f'Starting cleanup_files workflow once...\n'
|
||||
f' workflow_id = {workflow_id}\n'
|
||||
f' task_queue = {task_queue}\n'
|
||||
f' bucket_name = {bucket_name}'
|
||||
)
|
||||
|
||||
handle = await client.start_workflow(
|
||||
CleanupFiles.run,
|
||||
@@ -79,9 +81,9 @@ async def main(argv: list[str]) -> None:
|
||||
run_timeout=timedelta(minutes=10),
|
||||
)
|
||||
|
||||
print("Workflow started, waiting for completion...")
|
||||
print('Workflow started, waiting for completion...')
|
||||
await handle.result()
|
||||
print("cleanup_files workflow completed successfully.")
|
||||
print('cleanup_files workflow completed successfully.')
|
||||
|
||||
|
||||
if __name__ == '__main__': # pragma: no cover - manual utility script
|
||||
|
||||
Reference in New Issue
Block a user