26 lines
816 B
Python
26 lines
816 B
Python
import asyncio
|
|
import sys
|
|
import os
|
|
|
|
# Добавляем путь к проекту в sys.path
|
|
project_root = "/home/matrixhasyou/domovoy_bot"
|
|
if project_root not in sys.path:
|
|
sys.path.insert(0, project_root)
|
|
os.chdir(project_root)
|
|
|
|
from database.db import AsyncSessionLocal
|
|
from services.chat_exporter import ChatExporter
|
|
|
|
async def manual_export():
|
|
print("[*] Starting manual export to Forgejo...")
|
|
async with AsyncSessionLocal() as session:
|
|
exporter = ChatExporter(session)
|
|
result = await exporter.run_full_export()
|
|
print(f"[*] Result: {result}")
|
|
if result.get("success"):
|
|
print("✅ Export completed successfully!")
|
|
else:
|
|
print(f"❌ Export failed: {result.get('error')}")
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(manual_export())
|