From eef32809f45e10dbdeb74c8719ab01cc8418e7f0 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 12 Aug 2015 16:49:56 +0200 Subject: [PATCH] Made sleep interval configurable --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 0986f63..09e80ce 100644 --- a/main.go +++ b/main.go @@ -17,6 +17,7 @@ var config = struct { SealTokensRaw string `flag:"tokens" default:"" description:"Tokens to try for unsealing the vault instance"` SealTokens []string VaultInstance string `flag:"instance" env:"VAULT_ADDR" default:"http://127.0.0.1:8200" description:"Vault instance to unlock"` + Sleep int `flag:"sleep" default:"30" description:"How long to wait between sealed-state checks"` }{} func init() { @@ -82,7 +83,7 @@ func main() { if config.OneShot { break } else { - <-time.After(10 * time.Second) + <-time.After(time.Duration(config.Sleep) * time.Second) } } }