Skip to content

Commit

Permalink
fix: role probe timeout problem #842 (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuriwuyun committed Dec 28, 2022
1 parent bc11dde commit 433f875
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/probe/internal/binding/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ func (m *Mysql) Operations() []bindings.OperationKind {
}

func (m *Mysql) InitIfNeed() error {
if m.db == nil {
go m.InitDelay()
return fmt.Errorf("Init db connection asynchronously.")
}
return nil
}

func (m *Mysql) InitDelay() error {
m.mu.Lock()
defer m.mu.Unlock()
if m.db != nil {
Expand Down

0 comments on commit 433f875

Please sign in to comment.