Fixed bug of timeout being hardcoded

This commit is contained in:
jamesread 2021-07-12 01:10:15 +01:00
parent 7dcc62ad1d
commit 800598b199
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ func execAction(cfg *config.Config, actualAction *config.ActionButton) *pb.Start
"timeout": actualAction.Timeout,
}).Infof("Found action")
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(actualAction.Timeout) * time.Second)
defer cancel()
cmd := exec.CommandContext(ctx, "sh", "-c", actualAction.Shell)