command: Comment to explain why unlock is required

pull/24122/head
Alisdair McDiarmid 6 years ago
parent 7d8ac1e318
commit aa38cbe3bc

@ -97,6 +97,7 @@ func (c *ConsoleCommand) Run(args []string) int {
// Get the context
ctx, _, ctxDiags := local.Context(opReq)
// Creating the context can result in a lock, so ensure we release it
defer func() {
err := opReq.StateLocker.Unlock(nil)
if err != nil {

@ -204,6 +204,7 @@ func (c *ImportCommand) Run(args []string) int {
// Get the context
ctx, state, ctxDiags := local.Context(opReq)
// Creating the context can result in a lock, so ensure we release it
defer func() {
err := opReq.StateLocker.Unlock(nil)
if err != nil {

Loading…
Cancel
Save