Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent Execution with Promise.all for Enhanced Resource Utilization ✈️ #1127

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dist/cleanup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cleanup/index.js.map

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions dist/main/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main/index.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ export async function run(cutoff = '24h'): Promise<void> {
await docker.pruneNetworks({filters: untilFilter})
core.info(`Pruning containers older than ${cutoff}`)
await docker.pruneContainers({filters: untilFilter})
for (const image of updaterImages()) {
await cleanupOldImageVersions(docker, image)
}
await Promise.all(
updaterImages().map(async image => {
return cleanupOldImageVersions(docker, image)
})
)
await cleanupOldImageVersions(docker, PROXY_IMAGE_NAME)
} catch (error: unknown) {
if (error instanceof Error) {
Expand Down
3 changes: 1 addition & 2 deletions src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ export class ProxyBuilder {
shutdown: async () => {
await container.stop()
await container.remove()
await externalNetwork.remove()
await internalNetwork.remove()
await Promise.all([externalNetwork.remove(), internalNetwork.remove()])
}
}
}
Expand Down
Loading