Skip to content

Commit

Permalink
Fix: disable RPC cache
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Sep 30, 2023
1 parent 4b6ce37 commit da6bb39
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions build/dipdup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ indexer:
class_interfaces_dir: ${INDEXER_CLASS_INTERFACES_DIR:-./interfaces/}
bridged_tokens_file: ${INDEXER_BRIDGED_TOKENS_FILE:-mainnet.json}
cache_dir: ${INDEXER_CACHE_DIR:-/etc/starknet}
cache: ${CACHE_ENABLED:-false}

grpc:
bind: ${GRPC_BIND:-127.0.0.1:7779}
Expand Down
1 change: 1 addition & 0 deletions pkg/indexer/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type Config struct {
ClassInterfacesDir string `yaml:"class_interfaces_dir" validate:"required,dir"`
BridgedTokensFile string `yaml:"bridged_tokens_file" validate:"required,file"`
CacheDir string `yaml:"cache_dir" validate:"omitempty,dir"`
Cache bool `yaml:"cache" validate:"omitempty"`
}

// Node -
Expand Down
4 changes: 3 additions & 1 deletion pkg/indexer/receiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ func NewReceiver(cfg config.Config) *Receiver {
if cfg.Sequencer.Rps > 0 {
opts = append(opts, starknet.WithRateLimit(cfg.Sequencer.Rps))
}
if cfg.CacheDir != "" {

log.Info().Bool("enabled", cfg.Cache).Str("dir", cfg.CacheDir).Msg("rpc response caching")
if cfg.Cache && cfg.CacheDir != "" {
opts = append(opts, starknet.WithCacheInFS(cfg.CacheDir))
}

Expand Down

0 comments on commit da6bb39

Please sign in to comment.