updated to work with apache proxying

This commit is contained in:
Sakimori 2022-06-15 21:59:51 -04:00
parent 1b7a32e3ec
commit 936305c88d
2 changed files with 15 additions and 7 deletions

View file

@ -118,7 +118,7 @@ def create_league():
### SOCKETS ### SOCKETS
thread2 = threading.Thread(target=socketio.run,args=(app,"0.0.0.0", "80")) thread2 = threading.Thread(target=socketio.run,args=(app,"127.0.0.1", "8080"))
thread2.start() thread2.start()
master_games_dic = {} #key timestamp : (game game, {} state) master_games_dic = {} #key timestamp : (game game, {} state)
@ -133,7 +133,10 @@ def update_loop():
global socket_thread global socket_thread
while True: while True:
if socket_thread is not None: if socket_thread is not None:
socket_thread.join() try:
socket_thread.join()
except:
pass
game_states = [] game_states = []
game_ids = iter(master_games_dic.copy().keys()) game_ids = iter(master_games_dic.copy().keys())
for game_id in game_ids: for game_id in game_ids:

View file

@ -9,6 +9,7 @@ import weather
data_dir = "data" data_dir = "data"
config_filename = os.path.join(data_dir, "config.json") config_filename = os.path.join(data_dir, "config.json")
app = main_controller.app
class Command: class Command:
def isauthorized(self, user): def isauthorized(self, user):
@ -718,7 +719,7 @@ class DraftFlagsCommand(Command):
async def execute(self, msg, command, flags): async def execute(self, msg, command, flags):
text = """Currently accepted flags: text = """Currently accepted flags:
--draftsize or -d: Sets the size of each draft pool. --draftsize or -d: Sets the size of each draft pool.
--minsize or -m: Sets the size at which the pool completely refreshes. --refresh or -r: Sets the size at which the pool completely refreshes.
--teamsize or -t: How big each team should be, including pitchers. --teamsize or -t: How big each team should be, including pitchers.
--pitchercount or -p: How many pitchers each team should have. --pitchercount or -p: How many pitchers each team should have.
--wait or -w: Sets the timeout, in seconds, to wait for draftees to pick a player. --wait or -w: Sets the timeout, in seconds, to wait for draftees to pick a player.
@ -792,9 +793,9 @@ class StartDraftCommand(Command):
if mention in handle_token: if mention in handle_token:
handle = mention handle = mention
break break
else: else:
await msg.channel.send(f"I don't recognize {handle_token}.") await msg.channel.send(f"I don't recognize {handle_token}.")
return return
team_name = content[i + 1].strip() team_name = content[i + 1].strip()
if games.get_team(team_name): if games.get_team(team_name):
await msg.channel.send(f'Sorry {handle}, {team_name} already exists') await msg.channel.send(f'Sorry {handle}, {team_name} already exists')
@ -1692,6 +1693,10 @@ active_standings = {}
setupmessages = {} setupmessages = {}
thread1 = threading.Thread(target=main_controller.update_loop)
thread1.start()
thread1 = threading.Thread(target=main_controller.update_loop) thread1 = threading.Thread(target=main_controller.update_loop)
thread1.start() thread1.start()