mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
add
This commit is contained in:
@@ -20,7 +20,7 @@ from discord.ext import commands
|
|||||||
from communication_subroutine import comm_subroutine
|
from communication_subroutine import comm_subroutine
|
||||||
from constants import ENCODING, LOGFILE, TOKEN
|
from constants import ENCODING, LOGFILE, TOKEN
|
||||||
logger = logging.getLogger("discord")
|
logger = logging.getLogger("discord")
|
||||||
logger.setLevel(logging.INFO)
|
logger.setLevel(logging.DEBUG)
|
||||||
handler = handlers.RotatingFileHandler(
|
handler = handlers.RotatingFileHandler(
|
||||||
filename=LOGFILE,
|
filename=LOGFILE,
|
||||||
encoding=ENCODING,
|
encoding=ENCODING,
|
||||||
@@ -114,6 +114,7 @@ async def main() -> None:
|
|||||||
shutdown_event = asyncio.Event()
|
shutdown_event = asyncio.Event()
|
||||||
comm_stop_event = threading.Event()
|
comm_stop_event = threading.Event()
|
||||||
|
|
||||||
|
|
||||||
comm_task = asyncio.create_task(_run_comm_subroutine(comm_stop_event))
|
comm_task = asyncio.create_task(_run_comm_subroutine(comm_stop_event))
|
||||||
bot_task = asyncio.create_task(_run_bot(TOKEN, shutdown_event))
|
bot_task = asyncio.create_task(_run_bot(TOKEN, shutdown_event))
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ from urllib import request as urequest
|
|||||||
from flask import Flask, abort, jsonify, request
|
from flask import Flask, abort, jsonify, request
|
||||||
from waitress import serve
|
from waitress import serve
|
||||||
|
|
||||||
HOST_ADDRESS = os.getenv("CONJURER_DISCORD_HOST", "192.168.1.31")
|
HOST_ADDRESS = os.getenv("CONJURER_DISCORD_HOST", "192.168.1.92")
|
||||||
PORT_ADDRESS = int(os.getenv("CONJURER_DISCORD_PORT", "5000"))
|
PORT_ADDRESS = int(os.getenv("CONJURER_DISCORD_PORT", "5000"))
|
||||||
ICECAST_ADDRESS = os.getenv("CONJURER_ICECAST", "http://192.168.1.15:8000")
|
ICECAST_ADDRESS = os.getenv("CONJURER_ICECAST", "http://192.168.1.12:8000")
|
||||||
API_KEY = os.getenv("CONJURER_API_KEY")
|
API_KEY = os.getenv("CONJURER_API_KEY")
|
||||||
OUT_COMM_Q = Queue()
|
OUT_COMM_Q = Queue()
|
||||||
IN_COMM_Q = Queue()
|
IN_COMM_Q = Queue()
|
||||||
@@ -234,11 +234,11 @@ def comm_subroutine(stop_event: Optional[threading.Event] = None):
|
|||||||
:param stop_event: optional :class:`threading.Event` shared with the caller
|
:param stop_event: optional :class:`threading.Event` shared with the caller
|
||||||
to coordinate a cooperative shutdown.
|
to coordinate a cooperative shutdown.
|
||||||
"""
|
"""
|
||||||
# logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
logger = logging.getLogger("discord")
|
logger = logging.getLogger("discord")
|
||||||
logger.info("Started comms")
|
logger.info("Started comms")
|
||||||
threads = []
|
threads = []
|
||||||
# threads.append(threading.Thread(target=flask_debug))
|
threads.append(threading.Thread(target=flask_debug))
|
||||||
threads.append(threading.Thread(target=waitress_run, daemon=True))
|
threads.append(threading.Thread(target=waitress_run, daemon=True))
|
||||||
threads.append(
|
threads.append(
|
||||||
threading.Thread(
|
threading.Thread(
|
||||||
|
|||||||
Reference in New Issue
Block a user