remove webhook queries in favor of using existing ones that ignore deleted webhooks, enforce not implemented for cloud users, get seats from license.features.users.

Этот коммит содержится в:
Conor Macpherson
2022-12-21 12:09:33 -05:00
родитель 77d3e3591a
Коммит f65aa61440
7 изменённых файлов: 6 добавлений и 209 удалений

Просмотреть файл

@@ -11240,22 +11240,6 @@ func (s *TimerLayerWebhookStore) GetIncomingListByUser(userID string, offset int
return result, err
}
func (s *TimerLayerWebhookStore) GetIncomingTotal() (int64, error) {
start := time.Now()
result, err := s.WebhookStore.GetIncomingTotal()
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingTotal", success, elapsed)
}
return result, err
}
func (s *TimerLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
start := time.Now()
@@ -11368,22 +11352,6 @@ func (s *TimerLayerWebhookStore) GetOutgoingListByUser(userID string, offset int
return result, err
}
func (s *TimerLayerWebhookStore) GetOutgoingTotal() (int64, error) {
start := time.Now()
result, err := s.WebhookStore.GetOutgoingTotal()
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingTotal", success, elapsed)
}
return result, err
}
func (s *TimerLayerWebhookStore) InvalidateWebhookCache(webhook string) {
start := time.Now()