mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-10-12 01:58:46 +02:00
23 lines
452 B
Go
23 lines
452 B
Go
package cli
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
"time"
|
|
)
|
|
|
|
// notifyReloadSigCh is a no-op on Windows platforms
|
|
func notifyReloadSigCh(ch chan os.Signal) {}
|
|
|
|
func stopNotifyReloadSigCh(ch chan os.Signal) {}
|
|
|
|
// sendReloadSignal sends a reload signal to the program
|
|
func (p *prog) sendReloadSignal() error {
|
|
select {
|
|
case p.reloadCh <- struct{}{}:
|
|
return nil
|
|
case <-time.After(5 * time.Second):
|
|
}
|
|
return errors.New("timeout while sending reload signal")
|
|
}
|