29 lines
841 B
Python
29 lines
841 B
Python
#!/usr/bin/env python3
|
|
"""Opt-in real PostgreSQL rollback smoke entry point."""
|
|
|
|
import os
|
|
import pathlib
|
|
import sys
|
|
|
|
PROJECT_ROOT = pathlib.Path(__file__).resolve().parents[3]
|
|
SCRIPT_DIR = PROJECT_ROOT / "muse" / "content" / "entity" / "skills" / "ingest" / "抽取作品知识" / "scripts"
|
|
sys.path.insert(0, str(SCRIPT_DIR))
|
|
import upgrade as pu # noqa: E402
|
|
|
|
|
|
def main():
|
|
if os.getenv("MUSE_REAL_PG_ROLLBACK_SMOKE") != "1":
|
|
print(
|
|
"BLOCKED: set MUSE_REAL_PG_ROLLBACK_SMOKE=1 to run the real PostgreSQL rollback smoke"
|
|
)
|
|
return 2
|
|
|
|
work_id = int(os.getenv("MUSE_REAL_PG_ROLLBACK_SMOKE_WORK_ID", "8"))
|
|
pu.real_pg_rollback_smoke(work_id)
|
|
print(f"PASS: real PostgreSQL rollback smoke completed for work_id={work_id}")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|