From aeeee3c1e3e9bfc38462cb315b6e19ee9fe6db70 Mon Sep 17 00:00:00 2001 From: Roman Melnikov Date: Wed, 1 Nov 2023 12:42:30 +0100 Subject: [Chore] Make activation wait timeout configurable Problem: Currently profile activation waiting timeout is hardcoded to 240 seconds, see https://github.com/serokell/deploy-rs/pull/48. In some cases, this timeout can be exceeded (e.g. activation performs a heavy DB migration and waits for it to finish before considering the profile activation succesful). Solution: Make this timeout configurable via 'activationTimeout' deploy attribute or corresponding '--activation-timeout' CLI option. For the sake of backward compatibility, the new 'wait' subcommand '--activation-timeout' option is made optional and defaults to 240 seconds if it wasn't provided. --- src/cli.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index cc17ea9..b25aed2 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -85,6 +85,9 @@ pub struct Opts { /// How long activation should wait for confirmation (if using magic-rollback) #[clap(long)] confirm_timeout: Option, + /// How long we should wait for profile activation (if using magic-rollback) + #[clap(long)] + activation_timeout: Option, /// Where to store temporary files (only used by magic-rollback) #[clap(long)] temp_path: Option, @@ -658,6 +661,7 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> { magic_rollback: opts.magic_rollback, temp_path: opts.temp_path, confirm_timeout: opts.confirm_timeout, + activation_timeout: opts.activation_timeout, dry_activate: opts.dry_activate, remote_build: opts.remote_build, sudo: opts.sudo, -- cgit v1.2.3