mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-25 15:08:45 +08:00
Rename ContextIsReadyToBeClosed
to InitDone
This commit is contained in:
@ -269,7 +269,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
|
||||
}
|
||||
|
||||
// our global interrupt handler can now try to stop the daemon
|
||||
close(req.Context().ContextIsReadyToBeClosed)
|
||||
close(req.Context().InitDone)
|
||||
|
||||
if rootRedirect != nil {
|
||||
opts = append(opts, rootRedirect)
|
||||
|
@ -137,7 +137,7 @@ func main() {
|
||||
// workaround is for the daemon only; other commands are always
|
||||
// ready to be stopped
|
||||
if invoc.cmd != daemonCmd {
|
||||
close(invoc.req.Context().ContextIsReadyToBeClosed)
|
||||
close(invoc.req.Context().InitDone)
|
||||
}
|
||||
|
||||
// ok, finally, run the command invocation.
|
||||
@ -482,7 +482,7 @@ func (i *cmdInvocation) setupInterruptHandler() {
|
||||
|
||||
go func() {
|
||||
// wait till the context is ready to be closed
|
||||
<-ctx.ContextIsReadyToBeClosed
|
||||
<-ctx.InitDone
|
||||
|
||||
// first time, try to shut down.
|
||||
|
||||
|
@ -28,9 +28,9 @@ type Context struct {
|
||||
config *config.Config
|
||||
LoadConfig func(path string) (*config.Config, error)
|
||||
|
||||
node *core.IpfsNode
|
||||
ConstructNode func() (*core.IpfsNode, error)
|
||||
ContextIsReadyToBeClosed chan bool
|
||||
node *core.IpfsNode
|
||||
ConstructNode func() (*core.IpfsNode, error)
|
||||
InitDone chan bool
|
||||
}
|
||||
|
||||
// GetConfig returns the config of the current Command exection
|
||||
@ -288,7 +288,7 @@ func NewRequest(path []string, opts OptMap, args []string, file files.File, cmd
|
||||
optDefs = make(map[string]Option)
|
||||
}
|
||||
|
||||
ctx := Context{Context: context.TODO(), ContextIsReadyToBeClosed: make(chan bool)}
|
||||
ctx := Context{Context: context.TODO(), InitDone: make(chan bool)}
|
||||
values := make(map[string]interface{})
|
||||
req := &request{path, opts, args, file, cmd, ctx, optDefs, values, os.Stdin}
|
||||
err := req.ConvertOptions()
|
||||
|
Reference in New Issue
Block a user