fix(pidproxy): replace Timer with Ticker

tested: ssh-docker
This commit is contained in:
Suyono 2023-12-26 09:53:37 +11:00
parent 70a4d132c3
commit 7785b3ec48
2 changed files with 6 additions and 2 deletions

View File

@ -105,8 +105,12 @@ background service is still running, in current implementation it checks every s
```shell ```shell
wmpidproxy --pid-file <path to pid file> -- <background service binary/start script> wmpidproxy --pid-file <path to pid file> -- <background service binary/start script>
``` ```
#### Example
Running sshd background with `wingmate` and `wmpidproxy`: [here](example/ssh-docker/)
## Wingmate Exec binary ## Wingmate Exec binary
## Wingmate core binary ## Wingmate core binary
### Service ### Service
### Cron ### Cron

View File

@ -94,13 +94,13 @@ func pidProxy(cmd *cobra.Command, args []string) error {
err error err error
pid int pid int
sc chan os.Signal sc chan os.Signal
t *time.Timer t *time.Ticker
) )
sc = make(chan os.Signal, 1) sc = make(chan os.Signal, 1)
signal.Notify(sc, unix.SIGTERM) signal.Notify(sc, unix.SIGTERM)
t = time.NewTimer(time.Second) t = time.NewTicker(time.Second)
check: check:
for { for {