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):
async def execute(self, message_bus, argument, filename):
with open(filename) as f:
data = f.readlines()
for line in data:
value = line.strip()
if value != "":
logger.info(
"Dispatching `%s` with `%s` on `%s`.",
argument,
value,
self.rabotnik_message,
)
await message_bus.send(
message=self.rabotnik_message, payload={self.payload_argument: value}
)
for line in f:
value = line.strip()
if value != "":
logger.info(
"Dispatching `%s` with `%s` on `%s`.",
argument,
value,
self.rabotnik_message,
)
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