Add process controls and restart command
This commit is contained in:
@@ -8,7 +8,7 @@ from typing import Any
|
||||
from pyrogram import Client, idle
|
||||
|
||||
from app.ai import AIService
|
||||
from app.commands import DEFAULT_REGISTRY, CommandRegistry, RuntimeAclStore
|
||||
from app.commands import DEFAULT_REGISTRY, CommandRegistry, RuntimeAclStore, load_persistent_commands
|
||||
from app.config import AccountConfig, AppConfig
|
||||
from app.github_webhook import GitHubWebhookServer
|
||||
from app.handlers import register_common_handlers
|
||||
@@ -37,6 +37,10 @@ class AccountManager:
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
self.command_registry = DEFAULT_REGISTRY
|
||||
if self.config.ai is not None:
|
||||
loaded = load_persistent_commands(self.config.ai.workspace_dir / "commands", self.command_registry)
|
||||
if loaded:
|
||||
log.info("Loaded persistent commands: %s", ", ".join(loaded))
|
||||
self.ai_service = AIService(self.config.ai) if self.config.ai is not None else None
|
||||
self.states = [AccountState(config=account) for account in self.config.accounts]
|
||||
self.github_webhook_server = GitHubWebhookServer(self, self.config.github_webhook)
|
||||
|
||||
Reference in New Issue
Block a user