mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Fixed!
This commit is contained in:
@@ -2220,7 +2220,7 @@ if __name__ == "__main__":
|
|||||||
logger.info("Starting discord bot")
|
logger.info("Starting discord bot")
|
||||||
threads = []
|
threads = []
|
||||||
threads.append(threading.Thread(target=client.run, args=(TOKEN,)))
|
threads.append(threading.Thread(target=client.run, args=(TOKEN,)))
|
||||||
threads.append(threading.Thread(target=communication_subroutine.comm_subroutine, args=(OUT_COMM_Q,)))
|
threads.append(threading.Thread(target=communication_subroutine.comm_subroutine, args=(OUT_COMM_Q,IN_COMM_Q)))
|
||||||
for worker in threads:
|
for worker in threads:
|
||||||
worker.start()
|
worker.start()
|
||||||
for worker in threads:
|
for worker in threads:
|
||||||
|
|||||||
@@ -23,9 +23,10 @@ def answer_external_command():
|
|||||||
#)
|
#)
|
||||||
#return return_data
|
#return return_data
|
||||||
return jsonify("SUCCESS")
|
return jsonify("SUCCESS")
|
||||||
|
|
||||||
@app.route("/conjurer", methods=["GET"])
|
@app.route("/conjurer", methods=["GET"])
|
||||||
def check_alive():
|
def check_alive():
|
||||||
return jsonify("SUCCESS")
|
return jsonify("ALIVE")
|
||||||
|
|
||||||
def flask_debug(_logger):
|
def flask_debug(_logger):
|
||||||
"""
|
"""
|
||||||
@@ -45,20 +46,22 @@ def waitress_run(_logger):
|
|||||||
_logger.info("Attempt waitress")
|
_logger.info("Attempt waitress")
|
||||||
serve(app, host=HOST_ADDRESS, port=PORT_ADDRESS)
|
serve(app, host=HOST_ADDRESS, port=PORT_ADDRESS)
|
||||||
|
|
||||||
def scan_queue(comm_q):
|
def scan_queue(comm_q,out_queue):
|
||||||
while True:
|
while True:
|
||||||
data = comm_q.get()
|
data = comm_q.get()
|
||||||
print(data)
|
print(data)
|
||||||
|
out_queue.put("Test")
|
||||||
|
|
||||||
|
|
||||||
def comm_subroutine(comm_q):
|
def comm_subroutine(in_comm_q, out_com_q):
|
||||||
queue = comm_q
|
in_queue = in_comm_q
|
||||||
|
out_queue = out_com_q
|
||||||
logger = logging.getLogger('conjurer_musician')
|
logger = logging.getLogger('conjurer_musician')
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
logger.info("Started")
|
logger.info("Started")
|
||||||
threads = []
|
threads = []
|
||||||
threads.append(threading.Thread(target=waitress_run, args=(logger,)))
|
threads.append(threading.Thread(target=waitress_run, args=(logger,)))
|
||||||
threads.append(threading.Thread(target=scan_queue, args=(queue,)))
|
threads.append(threading.Thread(target=scan_queue, args=(in_queue,out_queue)))
|
||||||
|
|
||||||
for worker in threads:
|
for worker in threads:
|
||||||
worker.start()
|
worker.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user