diff --git a/flow-state/store/mem/step.go b/flow-state/store/mem/step.go index fefe623..b072d1d 100644 --- a/flow-state/store/mem/step.go +++ b/flow-state/store/mem/step.go @@ -25,14 +25,14 @@ type StepStore struct { snapshots sync.Map } -func (s *StepStore) GetDBPingStatus() bool { +func (s *StepStore) Status() bool { //TODO - return false + return true } -func (s *StepStore) GetMaxOpenConn() int { +func (s *StepStore) MaxConcurrencyLimit() int { //TODO - return 0 + return 20 // hardcoding some good number considering its usage for concurrent goroutines in SMService } func (s *StepStore) GetStatus(flowId string) int { diff --git a/flow-state/store/postgres/step.go b/flow-state/store/postgres/step.go index 6f35fd0..0b3f1d5 100644 --- a/flow-state/store/postgres/step.go +++ b/flow-state/store/postgres/step.go @@ -36,14 +36,14 @@ type StepStore struct { settings map[string]interface{} } -func (s *StepStore) GetDBPingStatus() bool { +func (s *StepStore) Status() bool { if err := s.db.db.Ping(); err != nil { return false } return true } -func (s *StepStore) GetMaxOpenConn() int { +func (s *StepStore) MaxConcurrencyLimit() int { connCount := s.db.db.Stats().MaxOpenConnections return connCount diff --git a/flow-state/store/store.go b/flow-state/store/store.go index e5921ae..5bb8886 100644 --- a/flow-state/store/store.go +++ b/flow-state/store/store.go @@ -19,8 +19,8 @@ const ( ) type Store interface { - GetMaxOpenConn() int - GetDBPingStatus() bool + MaxConcurrencyLimit() int + Status() bool GetStatus(flowId string) int GetFlow(flowId string, metadata *metadata.Metadata) (*state.FlowInfo, error) GetFlows(metadata *metadata.Metadata) ([]*state.FlowInfo, error)