[MM-53291] Data retention improvements (#24253)

* adding new migration for RetentionIdsForDeletion, changing logic for deleting orphaned reactions. Updating delete user and channel endpoints to remove respective reactions
Этот коммит содержится в:
Ben Cooke
2023-09-06 08:25:27 -04:00
коммит произвёл GitHub
родитель d13429aa92
Коммит 791ee40568
27 изменённых файлов: 820 добавлений и 275 удалений

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

@@ -210,6 +210,7 @@ const (
DataRetentionSettingsDefaultDeletionJobStartTime = "02:00"
DataRetentionSettingsDefaultBatchSize = 3000
DataRetentionSettingsDefaultTimeBetweenBatchesMilliseconds = 100
DataRetentionSettingsDefaultRetentionIdsBatchSize = 100
PluginSettingsDefaultDirectory = "./plugins"
PluginSettingsDefaultClientDirectory = "./client/plugins"
@@ -2868,6 +2869,7 @@ type DataRetentionSettings struct {
DeletionJobStartTime *string `access:"compliance_data_retention_policy"`
BatchSize *int `access:"compliance_data_retention_policy"`
TimeBetweenBatchesMilliseconds *int `access:"compliance_data_retention_policy"`
RetentionIdsBatchSize *int `access:"compliance_data_retention_policy"`
}
func (s *DataRetentionSettings) SetDefaults() {
@@ -2906,6 +2908,9 @@ func (s *DataRetentionSettings) SetDefaults() {
if s.TimeBetweenBatchesMilliseconds == nil {
s.TimeBetweenBatchesMilliseconds = NewInt(DataRetentionSettingsDefaultTimeBetweenBatchesMilliseconds)
}
if s.RetentionIdsBatchSize == nil {
s.RetentionIdsBatchSize = NewInt(DataRetentionSettingsDefaultRetentionIdsBatchSize)
}
}
type JobSettings struct {

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

@@ -84,3 +84,15 @@ type RetentionPolicyCursor struct {
TeamPoliciesDone bool
GlobalPoliciesDone bool
}
type RetentionIdsForDeletion struct {
Id string
TableName string
Ids []string
}
func (r *RetentionIdsForDeletion) PreSave() {
if r.Id == "" {
r.Id = NewId()
}
}

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

@@ -45,8 +45,6 @@ type FeatureFlags struct {
EnableExportDirectDownload bool
DataRetentionConcurrencyEnabled bool
StreamlinedMarketplace bool
}
@@ -63,7 +61,6 @@ func (f *FeatureFlags) SetDefaults() {
f.OnboardingTourTips = true
f.CloudReverseTrial = false
f.EnableExportDirectDownload = false
f.DataRetentionConcurrencyEnabled = true
f.StreamlinedMarketplace = true
}