Make backend.StateMgr accept a context (#780)

Signed-off-by: Marcin Wyszynski <marcin.pixie@gmail.com>
This commit is contained in:
Marcin Wyszynski
2023-10-24 15:47:46 +02:00
committed by GitHub
parent f906c4792a
commit a6a54c3777
71 changed files with 534 additions and 268 deletions

View File

@@ -4,6 +4,7 @@
package command
import (
"context"
"fmt"
"os"
"strings"
@@ -101,7 +102,8 @@ func (c *WorkspaceNewCommand) Run(args []string) int {
}
}
_, err = b.StateMgr(workspace)
ctx := context.Background()
_, err = b.StateMgr(ctx, workspace)
if err != nil {
c.Ui.Error(err.Error())
return 1
@@ -122,7 +124,7 @@ func (c *WorkspaceNewCommand) Run(args []string) int {
}
// load the new Backend state
stateMgr, err := b.StateMgr(workspace)
stateMgr, err := b.StateMgr(ctx, workspace)
if err != nil {
c.Ui.Error(err.Error())
return 1