settings: Add queue for repositories

This commit is contained in:
2021-01-16 21:52:22 +03:00
parent 97fb017e7e
commit ba5706e5e3

View File

@@ -32,13 +32,14 @@ If you want to opt out of PRs like this or want to provide feedback, please cont
RABBIT_HOST = os.getenv("RABBIT_HOST", "127.0.0.1")
RABBIT_PORT = int(os.getenv("RABBIT_PORT", 5672))
RABBIT_CREDENTIALS = ("alex", "testtest")
_RABBIT_BASE_QUEUE = "tasks.analyze"
RABBIT_TASK_QUEUE = _RABBIT_BASE_QUEUE + ".in"
RABBIT_REPLY_QUEUE = _RABBIT_BASE_QUEUE + ".out"
_RABBIT_BASE_TASK_QUEUE = "tasks.analyze"
RABBIT_TASK_QUEUE = _RABBIT_BASE_TASK_QUEUE + ".in"
RABBIT_REPLY_QUEUE = _RABBIT_BASE_TASK_QUEUE + ".out"
RABBIT_REPOSITORY_QUEUE = "github.repositories"
LOGGING_FORMAT = "%(asctime)s.%(msecs)03d %(levelname)s %(module)s: %(message)s"
LOGGING_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
LOGS_PATH = '/var/log/assets-bot'
LOGS_PATH = "/var/log/assets-bot"
def init_logging():
@@ -46,8 +47,7 @@ def init_logging():
logging.basicConfig(format=LOGGING_FORMAT, datefmt=LOGGING_DATE_FORMAT, level=logging.INFO)
else:
out_path = os.path.join(
LOGS_PATH,
os.path.basename(os.path.normpath(sys.argv[0].replace(".py", ".log")))
LOGS_PATH, os.path.basename(os.path.normpath(sys.argv[0].replace(".py", ".log")))
)
logging.basicConfig(
filename=out_path,