mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Testing
This commit is contained in:
@@ -2229,7 +2229,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,IN_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:
|
||||
|
||||
@@ -4,7 +4,7 @@ import json
|
||||
|
||||
from flask import Flask, jsonify, request
|
||||
from waitress import serve
|
||||
|
||||
from bot import IN_COMM_Q, OUT_COMM_Q
|
||||
|
||||
HOST_ADDRESS = "192.168.1.191"
|
||||
PORT_ADDRESS = 5000
|
||||
@@ -22,6 +22,7 @@ def answer_external_command():
|
||||
# 200,
|
||||
#)
|
||||
#return return_data
|
||||
IN_COMM_Q.put("Test")
|
||||
return jsonify("SUCCESS")
|
||||
|
||||
@app.route("/conjurer", methods=["GET"])
|
||||
@@ -46,22 +47,20 @@ def waitress_run(_logger):
|
||||
_logger.info("Attempt waitress")
|
||||
serve(app, host=HOST_ADDRESS, port=PORT_ADDRESS)
|
||||
|
||||
def scan_queue(comm_q,out_queue):
|
||||
def scan_queue():
|
||||
while True:
|
||||
data = comm_q.get()
|
||||
data = OUT_COMM_Q.get()
|
||||
print(data)
|
||||
out_queue.put("Test")
|
||||
IN_COMM_Q.put("Test")
|
||||
|
||||
|
||||
def comm_subroutine(in_comm_q, out_com_q):
|
||||
in_queue = in_comm_q
|
||||
out_queue = out_com_q
|
||||
def comm_subroutine():
|
||||
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=(in_queue,out_queue)))
|
||||
threads.append(threading.Thread(target=scan_queue,))
|
||||
|
||||
for worker in threads:
|
||||
worker.start()
|
||||
|
||||
Reference in New Issue
Block a user