summaryrefslogtreecommitdiff
path: root/internal/cli/serve
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2022-05-31 15:31:39 +0200
committerValery Piashchynski <[email protected]>2022-05-31 15:31:39 +0200
commit01b7dd6fb5a8c63dc3e0f4c5444c859c3266c97d (patch)
tree1b711bcb13fbc350807cd43a5b752e1f3b0815f1 /internal/cli/serve
parent467e427bf67bffe3dd0df41842dad797b93f56f9 (diff)
add force stop
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'internal/cli/serve')
-rw-r--r--internal/cli/serve/command.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/cli/serve/command.go b/internal/cli/serve/command.go
index 6cbdef44..a85beb89 100644
--- a/internal/cli/serve/command.go
+++ b/internal/cli/serve/command.go
@@ -5,6 +5,7 @@ import (
"os"
"os/signal"
"syscall"
+ "time"
"github.com/roadrunner-server/roadrunner/v2/internal/container"
"github.com/roadrunner-server/roadrunner/v2/internal/meta"
@@ -73,7 +74,7 @@ func NewCommand(override *[]string, cfgFile *string, silent *bool) *cobra.Comman
return errors.E(op, err)
}
- oss, stop := make(chan os.Signal, 2), make(chan struct{}, 1) //nolint:gomnd
+ oss, stop := make(chan os.Signal, 5), make(chan struct{}, 1) //nolint:gomnd
signal.Notify(oss, os.Interrupt, syscall.SIGTERM, syscall.SIGINT)
go func() {
@@ -100,6 +101,7 @@ func NewCommand(override *[]string, cfgFile *string, silent *bool) *cobra.Comman
case <-stop: // stop the container after first signal
fmt.Printf("stop signal received, grace timeout is: %0.f seconds\n", containerCfg.GracePeriod.Seconds())
+ time.Sleep(time.Second * 100)
if err = endureContainer.Stop(); err != nil {
return fmt.Errorf("error: %w", err)
}