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")
|
||||
threads = []
|
||||
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:
|
||||
worker.start()
|
||||
for worker in threads:
|
||||
|
||||
@@ -23,9 +23,10 @@ def answer_external_command():
|
||||
#)
|
||||
#return return_data
|
||||
return jsonify("SUCCESS")
|
||||
|
||||
@app.route("/conjurer", methods=["GET"])
|
||||
def check_alive():
|
||||
return jsonify("SUCCESS")
|
||||
return jsonify("ALIVE")
|
||||
|
||||
def flask_debug(_logger):
|
||||
"""
|
||||
@@ -45,20 +46,22 @@ def waitress_run(_logger):
|
||||
_logger.info("Attempt waitress")
|
||||
serve(app, host=HOST_ADDRESS, port=PORT_ADDRESS)
|
||||
|
||||
def scan_queue(comm_q):
|
||||
def scan_queue(comm_q,out_queue):
|
||||
while True:
|
||||
data = comm_q.get()
|
||||
print(data)
|
||||
out_queue.put("Test")
|
||||
|
||||
|
||||
def comm_subroutine(comm_q):
|
||||
queue = comm_q
|
||||
def comm_subroutine(in_comm_q, out_com_q):
|
||||
in_queue = in_comm_q
|
||||
out_queue = out_com_q
|
||||
logger = logging.getLogger('conjurer_musician')
|
||||
logger.setLevel(logging.DEBUG)
|
||||
logger.info("Started")
|
||||
threads = []
|
||||
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:
|
||||
worker.start()
|
||||
|
||||
Reference in New Issue
Block a user