Rename `ContextIsReadyToBeClosed` to `InitDone`
Konstantin Koroviev committed
Mar 12, 2015 at 11:42 UTC
d23bed5baa2bd2cb86580021d0a2f09d16792a06
3 files changed
+7
-7
cmd/ipfs/daemon.go
+1
-1
@@ -269,7 +269,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
269
}
270
271
// our global interrupt handler can now try to stop the daemon
272
- close(req.Context().ContextIsReadyToBeClosed)
272
+ close(req.Context().InitDone)
273
274
if rootRedirect != nil {
275
opts = append(opts, rootRedirect)
cmd/ipfs/main.go
+2
-2
@@ -137,7 +137,7 @@ func main() {
137
// workaround is for the daemon only; other commands are always
138
// ready to be stopped
139
if invoc.cmd != daemonCmd {
140
- close(invoc.req.Context().ContextIsReadyToBeClosed)
140
+ close(invoc.req.Context().InitDone)
141
}
142
143
// ok, finally, run the command invocation.
@@ -482,7 +482,7 @@ func (i *cmdInvocation) setupInterruptHandler() {
482
483
go func() {
484
// wait till the context is ready to be closed
485
- <-ctx.ContextIsReadyToBeClosed
485
+ <-ctx.InitDone
486
487
// first time, try to shut down.
488
commands/request.go
+4
-4
@@ -28,9 +28,9 @@ type Context struct {
28
config *config.Config
29
LoadConfig func(path string) (*config.Config, error)
30
31
- node *core.IpfsNode
32
- ConstructNode func() (*core.IpfsNode, error)
33
- ContextIsReadyToBeClosed chan bool
31
+ node *core.IpfsNode
32
+ ConstructNode func() (*core.IpfsNode, error)
33
+ InitDone chan bool
34
}
35
36
// 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
288
optDefs = make(map[string]Option)
289
}
290
291
- ctx := Context{Context: context.TODO(), ContextIsReadyToBeClosed: make(chan bool)}
291
+ ctx := Context{Context: context.TODO(), InitDone: make(chan bool)}
292
values := make(map[string]interface{})
293
req := &request{path, opts, args, file, cmd, ctx, optDefs, values, os.Stdin}
294
err := req.ConvertOptions()