Skip to content

Commit

Permalink
renaming funcs to Status() & MaxConcurrencyLimit()
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhagwat-tibco committed Jun 13, 2022
1 parent 86f9ab0 commit 69bd03e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions flow-state/store/mem/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions flow-state/store/postgres/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions flow-state/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 69bd03e

Please sign in to comment.