server alive
This commit is contained in:
parent
1c17b57d8a
commit
fab0e979d5
11 changed files with 353 additions and 28 deletions
24
test_db_connection.py
Executable file
24
test_db_connection.py
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test script to verify database connection.
|
||||
This script attempts to connect to the PostgreSQL database using the same
|
||||
connection logic as the main application.
|
||||
"""
|
||||
|
||||
import sys
|
||||
from oedb.utils.db import check_db_connection
|
||||
from oedb.utils.logging import logger
|
||||
|
||||
def main():
|
||||
"""Test database connection and print the result."""
|
||||
logger.info("Testing database connection...")
|
||||
|
||||
if check_db_connection():
|
||||
logger.success("Database connection successful!")
|
||||
return 0
|
||||
else:
|
||||
logger.error("Database connection failed. Check your .env file and PostgreSQL configuration.")
|
||||
return 1
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Loading…
Add table
Add a link
Reference in a new issue