File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,6 @@ package main
33import (
44 "context"
55 "flag"
6- "log"
7- "os"
8- "strconv"
9-
106 "github.com/gatewayd-io/gatewayd-plugin-cache/plugin"
117 sdkConfig "github.com/gatewayd-io/gatewayd-plugin-sdk/config"
128 "github.com/gatewayd-io/gatewayd-plugin-sdk/logging"
@@ -17,6 +13,8 @@ import (
1713 "github.com/hashicorp/go-hclog"
1814 goplugin "github.com/hashicorp/go-plugin"
1915 "github.com/spf13/cast"
16+ "log"
17+ "os"
2018)
2119
2220func main () {
@@ -53,9 +51,8 @@ func main() {
5351 go metrics .ExposeMetrics (metricsConfig , logger )
5452 }
5553
56- cacheBufferSizeStr := sdkConfig .GetEnv ("CACHE_CHANNEL_BUFFER_SIZE" , "100" )
57- cacheBufferSize , err := strconv .Atoi (cacheBufferSizeStr )
58- if err != nil || cacheBufferSize <= 0 {
54+ cacheBufferSize := cast .ToUint (cfg ["cacheBufferSize" ])
55+ if cacheBufferSize <= 0 {
5956 cacheBufferSize = 100 // default value
6057 }
6158
Original file line number Diff line number Diff line change 4545 "PERIODIC_INVALIDATOR_INTERVAL" , "1m" ),
4646 "apiAddress" : sdkConfig .GetEnv ("API_ADDRESS" , "localhost:8080" ),
4747 "exitOnStartupError" : sdkConfig .GetEnv ("EXIT_ON_STARTUP_ERROR" , "false" ),
48+ "cacheBufferSize" : sdkConfig .GetEnv ("CACHE_CHANNEL_BUFFER_SIZE" , "100" ),
4849 },
4950 "hooks" : []interface {}{
5051 int32 (v1 .HookName_HOOK_NAME_ON_CLOSED ),
You can’t perform that action at this time.
0 commit comments