Commit 74425f5d authored by Felix Delattre's avatar Felix Delattre
Browse files

Lazy read arguments file

parent 4d62da2f
Pipeline #22290 passed with stage
in 1 minute and 6 seconds
...@@ -33,17 +33,15 @@ class ArgumentBuildingIdsFile(ArgumentBase): ...@@ -33,17 +33,15 @@ class ArgumentBuildingIdsFile(ArgumentBase):
async def execute(self, message_bus, argument, filename): async def execute(self, message_bus, argument, filename):
with open(filename) as f: with open(filename) as f:
data = f.readlines() for line in f:
value = line.strip()
for line in data: if value != "":
value = line.strip() logger.info(
if value != "": "Dispatching `%s` with `%s` on `%s`.",
logger.info( argument,
"Dispatching `%s` with `%s` on `%s`.", value,
argument, self.rabotnik_message,
value, )
self.rabotnik_message, await message_bus.send(
) message=self.rabotnik_message, payload={self.payload_argument: value}
await message_bus.send( )
message=self.rabotnik_message, payload={self.payload_argument: value}
)
Markdown is supported
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