[MM-48029] notify admin for plugin install from work templates (#22007)
Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: Julien Tant <julien@craftyx.fr>
Этот коммит содержится в:
@@ -4764,7 +4764,7 @@ func (s *TimerLayerNotifyAdminStore) Get(trial bool) ([]*model.NotifyAdminData,
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerNotifyAdminStore) GetDataByUserIdAndFeature(userId string, feature model.MattermostPaidFeature) ([]*model.NotifyAdminData, error) {
|
||||
func (s *TimerLayerNotifyAdminStore) GetDataByUserIdAndFeature(userId string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.NotifyAdminStore.GetDataByUserIdAndFeature(userId, feature)
|
||||
@@ -4796,6 +4796,22 @@ func (s *TimerLayerNotifyAdminStore) Save(data *model.NotifyAdminData) (*model.N
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerNotifyAdminStore) Update(userId string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.NotifyAdminStore.Update(userId, requiredPlan, requiredFeature, now)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
success := "false"
|
||||
if err == nil {
|
||||
success = "true"
|
||||
}
|
||||
s.Root.Metrics.ObserveStoreMethodDuration("NotifyAdminStore.Update", success, elapsed)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerOAuthStore) DeleteApp(id string) error {
|
||||
start := time.Now()
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user