checkpoint

This commit is contained in:
sawka
2024-05-21 21:15:11 -07:00
parent 9e7e7af04a
commit 2317ce87f3
7 changed files with 212 additions and 2 deletions
+8 -1
View File
@@ -4,8 +4,10 @@
package blockservice
import (
"context"
"fmt"
"strings"
"time"
"github.com/wavetermdev/thenextwave/pkg/blockcontroller"
"github.com/wavetermdev/thenextwave/pkg/util/utilfn"
@@ -41,7 +43,12 @@ func (bs *BlockService) CloseBlock(blockId string) {
}
func (bs *BlockService) GetBlockData(blockId string) (map[string]any, error) {
blockData := wstore.BlockMap.Get(blockId)
ctx, cancelFn := context.WithTimeout(context.Background(), 2*time.Second)
defer cancelFn()
blockData, err := wstore.BlockGet(ctx, blockId)
if err != nil {
return nil, fmt.Errorf("error getting block data: %w", err)
}
if blockData == nil {
return nil, nil
}