Skip to content

Commit 790e018

Browse files
committed
Reduce down time while updating
1 parent 192f6c1 commit 790e018

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

doxy/cli.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,13 @@ def control(ctx, service, command):
8989
@only_if_service_exists
9090
def update(ctx, service, remove):
9191
compose_file = get_compose_file(Path(CONFIG.root_directory) / service)
92-
command_chain = {
93-
f"Stopping {service}": ["down" if remove else "stop"],
94-
f"Pulling {service} images": ["pull"],
95-
f"Starting {service}": ["up", "-d"],
96-
}
97-
for title, command in command_chain.items():
92+
command_chain = [
93+
(f"Pulling {service} images", ["pull"]),
94+
(f"Starting {service}", ["up", "-d"]),
95+
]
96+
if remove:
97+
command_chain.insert(0, (f"Stopping {service}", ["down"]))
98+
for title, command in command_chain:
9899
output.print_header(ctx, title)
99100
docker_compose_command(command, compose_file)
100101

0 commit comments

Comments
 (0)