command: Comment to explain why unlock is required
This commit is contained in:
parent
7d8ac1e318
commit
aa38cbe3bc
|
@ -97,6 +97,7 @@ func (c *ConsoleCommand) Run(args []string) int {
|
||||||
// Get the context
|
// Get the context
|
||||||
ctx, _, ctxDiags := local.Context(opReq)
|
ctx, _, ctxDiags := local.Context(opReq)
|
||||||
|
|
||||||
|
// Creating the context can result in a lock, so ensure we release it
|
||||||
defer func() {
|
defer func() {
|
||||||
err := opReq.StateLocker.Unlock(nil)
|
err := opReq.StateLocker.Unlock(nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -204,6 +204,7 @@ func (c *ImportCommand) Run(args []string) int {
|
||||||
// Get the context
|
// Get the context
|
||||||
ctx, state, ctxDiags := local.Context(opReq)
|
ctx, state, ctxDiags := local.Context(opReq)
|
||||||
|
|
||||||
|
// Creating the context can result in a lock, so ensure we release it
|
||||||
defer func() {
|
defer func() {
|
||||||
err := opReq.StateLocker.Unlock(nil)
|
err := opReq.StateLocker.Unlock(nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue