Commit 99ce0cb5 authored by Marius Kriegerowski's avatar Marius Kriegerowski
Browse files

Removed rabotnik log config. Added parallelization limit

parent 0a296f52
Pipeline #28037 passed with stage
in 1 minute and 13 seconds
......@@ -29,9 +29,6 @@ from .rules import GetFloorspace
from .rules import GetBuildingLandUse
from .rules import GetPointsInBuilding
rabotnik_logger = logging.getLogger("rabotnik")
rabotnik_logger.setLevel(logging.DEBUG)
rabotnik_logger.addHandler(logging.StreamHandler(sys.stdout))
logger = logging.getLogger(__name__)
......@@ -63,7 +60,9 @@ async def connected_storages(config_consumer, config_producer):
return storage_consumer, storage_contributor
async def start_rabotnik_obm(message_bus, storage_consumer, storage_contributor):
async def start_rabotnik_obm(
message_bus, storage_consumer, storage_contributor, n_processes_max
):
rules = [
GetBuilding(storage_consumer, storage_contributor),
......@@ -71,7 +70,7 @@ async def start_rabotnik_obm(message_bus, storage_consumer, storage_contributor)
GetBuildingLandUse(storage_consumer),
GetPointsInBuilding(storage_consumer),
]
rules = Assembly(rules=rules)
rules = Assembly(rules=rules, n_processes_max=n_processes_max)
await message_bus.subscribe("building", rules.run)
......@@ -83,7 +82,9 @@ async def start_rabotnik(args):
message_bus = await connected_message_bus(args.config_message_bus)
await start_rabotnik_obm(message_bus, storage_consumer, storage_contributor)
await start_rabotnik_obm(
message_bus, storage_consumer, storage_contributor, args.n_processes_max
)
def main():
......@@ -117,6 +118,14 @@ def main():
help="Rabotnik message bus configuration",
)
parser.add_argument(
"-np",
"--n-processes-max",
default=1,
type=int,
help="Max number of assemblies to run in parallel",
)
args = parser.parse_args()
default_log_level = logging.WARNING
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment