mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-02 20:59:06 +08:00
Local builds: avoid 'Hub not initialized. Queueing on the side' warnings
We don't need messages at all for local builds, so use a separate "drop" backend and reserve the "in_memory" backend for tests, where we sometimes want to inspect the messages. This avoids a warning for each published message.
This commit is contained in:
@@ -75,7 +75,7 @@ class ProdConfiguration(BaseConfiguration):
|
||||
class LocalBuildConfiguration(BaseConfiguration):
|
||||
CACHE_DIR = "~/modulebuild/cache"
|
||||
LOG_LEVEL = "debug"
|
||||
MESSAGING = "in_memory"
|
||||
MESSAGING = "drop"
|
||||
|
||||
ALLOW_CUSTOM_SCMURLS = True
|
||||
RESOLVER = "mbs"
|
||||
|
||||
@@ -95,6 +95,10 @@ def _in_memory_publish(topic, msg, conf, service):
|
||||
_initial_messages.append(wrapped_msg)
|
||||
|
||||
|
||||
def _drop_publish(topic, msg, conf, service):
|
||||
""" Drop the message on the floor (used for local builds). """
|
||||
|
||||
|
||||
known_fedmsg_services = ["buildsys", "mbs"]
|
||||
|
||||
|
||||
@@ -110,6 +114,12 @@ _in_memory_backend = {
|
||||
"services": [],
|
||||
"topic_suffix": ".",
|
||||
}
|
||||
_drop_backend = {
|
||||
"publish": _drop_publish,
|
||||
"parser": FedmsgMessageParser(known_fedmsg_services), # re-used. :)
|
||||
"services": [],
|
||||
"topic_suffix": ".",
|
||||
}
|
||||
|
||||
|
||||
_messaging_backends = {}
|
||||
|
||||
1
setup.py
1
setup.py
@@ -47,6 +47,7 @@ setup(
|
||||
"mbs.messaging_backends": [
|
||||
"fedmsg = module_build_service.common.messaging:_fedmsg_backend",
|
||||
"in_memory = module_build_service.common.messaging:_in_memory_backend",
|
||||
"drop = module_build_service.common.messaging:_drop_backend",
|
||||
# 'custom = your_organization:_custom_backend',
|
||||
],
|
||||
"mbs.builder_backends": [
|
||||
|
||||
Reference in New Issue
Block a user