diff --git a/gateway/server.go b/gateway/server.go index 876640e5cf3..e853d5824d6 100644 --- a/gateway/server.go +++ b/gateway/server.go @@ -335,7 +335,7 @@ func (gw *Gateway) setupGlobals() { time.Duration(gwConfig.DnsCache.CheckInterval)*time.Second) } - if gwConfig.EnableAnalytics && gwConfig.Storage.Type != "redis" { + if gwConfig.EnableAnalytics && gwConfig.Storage.Type != "redis" && gwConfig.Storage.Type != "local" { mainLog.Fatal("Analytics requires Redis Storage backend, please enable Redis in the tyk.conf file.") } @@ -1248,8 +1248,8 @@ func (gw *Gateway) initialiseSystem() error { } } - if gwConfig.Storage.Type != "redis" { - mainLog.Fatal("Redis connection details not set, please ensure that the storage type is set to Redis and that the connection parameters are correct.") + if gwConfig.Storage.Type != "redis" && gwConfig.Storage.Type != "local" { + mainLog.Fatal("storage connection details not set, please ensure that the storage type is set to Redis and that the connection parameters are correct.") } // suply rpc client globals to join it main loging and instrumentation sub systems diff --git a/go.mod b/go.mod index fca2be8fc9a..096ac9568b2 100644 --- a/go.mod +++ b/go.mod @@ -221,6 +221,8 @@ require ( nhooyr.io/websocket v1.8.10 // indirect ) +// replace github.com/TykTechnologies/storage => ../storage + //replace github.com/TykTechnologies/graphql-go-tools => ../graphql-go-tools //replace github.com/TykTechnologies/graphql-go-tools/v2 => ../graphql-go-tools/v2 diff --git a/storage/connection_handler.go b/storage/connection_handler.go index de22cd7d05b..93eaccf6cf3 100644 --- a/storage/connection_handler.go +++ b/storage/connection_handler.go @@ -238,6 +238,11 @@ func NewConnector(connType string, conf config.Config) (model.Connector, error) } log.Debug("Creating new " + connType + " Storage connection") + // we can ignore everything for a local connector + if cfg.Type == "local" { + return connector.NewConnector(model.LocalType) + } + // poolSize applies per cluster node and not for the whole cluster. poolSize := 500 if cfg.MaxActive > 0 {