Skip to content

Commit 3ad2370

Browse files
committed
fixes
1 parent 697f46c commit 3ad2370

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

server/factory/provider.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package factory
22

33
import (
4+
"time"
5+
46
"github.com/multiversx/mx-chain-core-go/core/pubkeyConverter"
57
hasherFactory "github.com/multiversx/mx-chain-core-go/hashing/factory"
68
marshalFactory "github.com/multiversx/mx-chain-core-go/marshal/factory"
@@ -12,6 +14,7 @@ import (
1214
"github.com/multiversx/mx-chain-rosetta/server/factory/components"
1315
"github.com/multiversx/mx-chain-rosetta/server/provider"
1416
"github.com/multiversx/mx-chain-rosetta/server/resources"
17+
"github.com/multiversx/mx-chain-storage-go/timecache"
1518
)
1619

1720
const (
@@ -119,7 +122,16 @@ func CreateNetworkProvider(args ArgsCreateNetworkProvider) (NetworkProvider, err
119122
return nil, err
120123
}
121124

122-
blockProcessor, err := process.NewBlockProcessor(baseProcessor)
125+
cacheDuration := time.Duration(30) * time.Second
126+
timedCache, err := timecache.NewTimeCacher(timecache.ArgTimeCacher{
127+
DefaultSpan: cacheDuration,
128+
CacheExpiry: cacheDuration,
129+
})
130+
if err != nil {
131+
return nil, err
132+
}
133+
134+
blockProcessor, err := process.NewBlockProcessor(baseProcessor, timedCache)
123135
if err != nil {
124136
return nil, err
125137
}

0 commit comments

Comments
 (0)