first take at "daemon stop" command

Fixes #1827

TODO: plumb the daemon-stopping into lotus-storage-miner, too
This commit is contained in:
laser
2020-06-02 12:29:58 -07:00
parent 5e727819ad
commit 38d714a28a
8 changed files with 49 additions and 9 deletions
+9 -3
View File
@@ -25,9 +25,10 @@ import (
type CommonAPI struct {
fx.In
APISecret *dtypes.APIAlg
Host host.Host
Router lp2p.BaseIpfsRouting
APISecret *dtypes.APIAlg
Host host.Host
Router lp2p.BaseIpfsRouting
ShutdownCh dtypes.ShutdownCh
}
type jwtPayload struct {
@@ -115,4 +116,9 @@ func (a *CommonAPI) LogSetLevel(ctx context.Context, subsystem, level string) er
return logging.SetLogLevel(subsystem, level)
}
func (a *CommonAPI) Shutdown(ctx context.Context) error {
a.ShutdownCh <- struct{}{}
return nil
}
var _ api.Common = &CommonAPI{}