Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: add doc link and remove test trigger (#5832)

rebelice9083a8ba0505
diff --git a/backend/api/v1/setting_service.go b/backend/api/v1/setting_service.go
index 893043f091..3dc9447676 100644
--- a/backend/api/v1/setting_service.go
+++ b/backend/api/v1/setting_service.go
@@ -182,7 +182,6 @@ func (s *SettingService) SetSetting(ctx context.Context, request *v1pb.SetSettin
apiValue.Password = &oldValue.Password
}
if request.ValidateOnly {
- s.stateCfg.TestSlowQueryWeeklyEmailChan <- true
if err := s.sendTestEmail(ctx, apiValue); err != nil {
return nil, status.Errorf(codes.InvalidArgument, "failed to validate smtp setting: %v", err)
}
diff --git a/backend/component/state/state.go b/backend/component/state/state.go
index 22b86b7350..7990d64bf4 100644
--- a/backend/component/state/state.go
+++ b/backend/component/state/state.go
@@ -41,8 +41,5 @@ type State struct {
// InstanceOutstandingConnections is the maximum number of connections per instance.
InstanceOutstandingConnections map[int]int
- // TestSlowQueryWeeklyEmailChan is the channel for testing slow query weekly email.
- TestSlowQueryWeeklyEmailChan chan bool
-
sync.Mutex
}
diff --git a/backend/runner/mail/slow_query_weekly_mail.go b/backend/runner/mail/slow_query_weekly_mail.go
index 879d2ea036..f7db6294d7 100644
--- a/backend/runner/mail/slow_query_weekly_mail.go
+++ b/backend/runner/mail/slow_query_weekly_mail.go
@@ -76,9 +76,6 @@ func (s *SlowQueryWeeklyMailSender) Run(ctx context.Context, wg *sync.WaitGroup)
if now.Weekday() == time.Saturday && now.Hour() == 0 {
s.sendEmail(ctx, now)
}
- case <-s.stateCfg.TestSlowQueryWeeklyEmailChan:
- log.Debug("Slow query weekly mail sender received test email")
- s.sendEmail(ctx, time.Now())
}
}
}
@@ -668,7 +665,7 @@ func (*SlowQueryWeeklyMailSender) sendNeedConfigSlowQueryPolicyEmail(mailSetting
}
body := strings.ReplaceAll(string(needConfigureTemplate), "{{VISIT_URL}}", visitURL)
- // TODO(rebelice): replace {{DOC_LINK}}
+ body = strings.ReplaceAll(body, "{{DOC_LINK}}", `https://www.bytebase.com/docs/slow-query/overview`)
email.SetFrom(fmt.Sprintf("Bytebase <%s>", mailSetting.SMTPFrom)).
AddTo(mailSetting.SMTPTo).
diff --git a/backend/server/server.go b/backend/server/server.go
index 7f7b9b073d..be41dafbd6 100644
--- a/backend/server/server.go
+++ b/backend/server/server.go
@@ -314,7 +314,6 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
InstanceDatabaseSyncChan: make(chan *api.Instance, 100),
InstanceSlowQuerySyncChan: make(chan *api.Instance, 100),
InstanceOutstandingConnections: make(map[int]int),
- TestSlowQueryWeeklyEmailChan: make(chan bool, 100),
}
s.store = storeInstance
s.licenseService, err = enterpriseService.NewLicenseService(profile.Mode, storeInstance)