Skip to content

Commit

Permalink
logged cc_sql version
Browse files Browse the repository at this point in the history
  • Loading branch information
navrotskyj committed Oct 24, 2023
1 parent e531300 commit aaa92e2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions queue/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ func (s *StatisticsManager) Start() {
wlog.Debug("starting statistics service")
s.watcher = utils.MakeWatcher("Statistics", STATISTICS_WATCHER_POLLING_INTERVAL, s.refresh)
s.startOnce.Do(func() {
ver, err := s.store.Statistic().LibVersion()
if err != nil {
wlog.Error(err.Error())
}
wlog.Debug(fmt.Sprintf("cc_sql version: %s", ver))

go s.watcher.Start()
})
}
Expand Down
11 changes: 11 additions & 0 deletions store/sqlstore/statistic.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,14 @@ func (s SqlStatisticStore) RefreshInbound1H() *model.AppError {

return nil
}

func (s *SqlStatisticStore) LibVersion() (string, *model.AppError) {
var str string
err := s.GetMaster().SelectOne(&str, `select x from call_center.cc_version() x`)
if err != nil {
return "", model.NewAppError("SqlMemberStore.LibVersion", "store.sql_member.lib_version.app_error", nil,
err.Error(), extractCodeFromErr(err))
}

return str, nil
}
1 change: 1 addition & 0 deletions store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ type GatewayStore interface {

type StatisticStore interface {
RefreshInbound1H() *model.AppError
LibVersion() (string, *model.AppError)
}

type TriggerStore interface {
Expand Down

0 comments on commit aaa92e2

Please sign in to comment.