[CLD-8131] Convert Subscription History Reporting to a Job (#27800)

* Remove CloudFreeDeprecated feature flag

* Fixes for CI pipelines

* Remove CloudReverseTrial feature flag and accompanying code (#27676)

Co-authored-by: Mattermost Build <build@mattermost.com>

* Stashing

* Convert subscription history reporting into a daily job

* Update comments

* Fix pipeline, redundant varaible declaration removed

* Add debug logs for start/finish

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Nick Misasi
2024-07-31 08:31:55 -04:00
коммит произвёл GitHub
родитель b1fd445fcc
Коммит 5bfb32c504
4 изменённых файлов: 34 добавлений и 24 удалений

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

@@ -19,6 +19,7 @@ func (a *App) AdjustInProductLimits(limits *model.ProductLimits, subscription *m
}
// Create/ Update a subscription history event
// This function is run daily to record the number of activated users in the system for Cloud workspaces
func (a *App) SendSubscriptionHistoryEvent(userID string) (*model.SubscriptionHistory, error) {
license := a.Srv().License()
@@ -27,10 +28,10 @@ func (a *App) SendSubscriptionHistoryEvent(userID string) (*model.SubscriptionHi
return nil, nil
}
// Get user count
userCount, err := a.Srv().Store().User().Count(model.UserCountOptions{})
if err != nil {
return nil, err
}
return a.Cloud().CreateOrUpdateSubscriptionHistoryEvent(userID, int(userCount))
}