add LIVE mode restr on test prods

This commit is contained in:
David Brazda
2023-11-15 11:04:16 +01:00
parent dc4c10a4a3
commit abc9e6148b
6 changed files with 65 additions and 3 deletions

View File

@ -0,0 +1,11 @@
import socket
from v2realbot.enums.enums import Env
from v2realbot.config import PROD_SERVER_HOSTNAMES, TEST_SERVER_HOSTNAMES
def get_environment():
"""Determine if the current server is production or test based on hostname."""
hostname = socket.gethostname()
if hostname in PROD_SERVER_HOSTNAMES:
return Env.PROD
else:
return Env.TEST