Skip to content

Commit

Permalink
feat: added health check and refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
orenlab committed Dec 30, 2024
1 parent 713a259 commit 47e8583
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ def main() -> NoReturn:

if args.health_check == "True":
health_status = HealthStatus()
print(f"Health check result: {health_status.last_health_check_result}")
sys.exit(0 if health_status.last_health_check_result else 1)
else:
launcher = BotLauncher()
Expand Down
4 changes: 2 additions & 2 deletions pytmbot/middleware/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ class SessionManager:
"""
A class for managing user sessions.
"""

_instance: Optional[Self] = None
_user_data: dict[int, dict[str, Any]] = field(default_factory=dict)
state_fabric: _StateFabric = _StateFabric()
_cleanup_interval: int = 600 # Cleanup expired sessions interval in seconds
session_timeout: int = 10 # Session timeout in minutes

def __init__(self):
self._SessionManager__user_data = None
# Initialize _user_data as an empty dictionary
self._SessionManager__user_data = self._user_data

def __new__(cls) -> SessionManager:
"""
Expand Down

0 comments on commit 47e8583

Please sign in to comment.