We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2207cf commit 7add0a2Copy full SHA for 7add0a2
lading/src/generator/container.rs
@@ -129,15 +129,13 @@ impl Container {
129
}
130
131
let number_of_containers = self.config.number_of_containers.unwrap_or(1);
132
- let mut containers = VecDeque::with_capacity(number_of_containers);
133
-
134
- for _ in 0..number_of_containers {
135
- containers.push_back(
136
- self.config
137
- .create_and_start_container(&docker, &full_image)
138
- .await?,
139
- );
140
- }
+ let mut containers = futures::future::join_all(
+ (0..number_of_containers)
+ .map(|_| self.config.create_and_start_container(&docker, &full_image)),
+ )
+ .await
+ .into_iter()
+ .collect::<Result<VecDeque<_>, Error>>()?;
141
142
// Wait for shutdown signal
143
let shutdown_wait = self.shutdown.recv();
0 commit comments