Disambiguates some units. (#19875)
* Disambiguates some units. * Updates DB attribute. * Updates some more error-prone units. * Updates some tests with legible constants. * Updates query for MySQL case sensitivity. * Fixes more casing issues. Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -1169,8 +1169,8 @@ func TestGetAllChannels(t *testing.T) {
|
|||||||
policyChannel := (sysManagerChannels)[0]
|
policyChannel := (sysManagerChannels)[0]
|
||||||
policy, err := th.App.Srv().Store.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
policy, err := th.App.Srv().Store.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "Policy 1",
|
DisplayName: "Policy 1",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
ChannelIDs: []string{policyChannel.Id},
|
ChannelIDs: []string{policyChannel.Id},
|
||||||
})
|
})
|
||||||
@@ -1621,8 +1621,8 @@ func TestSearchAllChannels(t *testing.T) {
|
|||||||
policyChannel := sysManagerChannels[0]
|
policyChannel := sysManagerChannels[0]
|
||||||
policy, savePolicyErr := th.App.Srv().Store.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
policy, savePolicyErr := th.App.Srv().Store.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "Policy 1",
|
DisplayName: "Policy 1",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
ChannelIDs: []string{policyChannel.Id},
|
ChannelIDs: []string{policyChannel.Id},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1501,7 +1501,7 @@ func getTeamIcon(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "image/png")
|
w.Header().Set("Content-Type", "image/png")
|
||||||
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%v, private", 24*60*60)) // 24 hrs
|
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%v, private", model.DayInSeconds)) // 24 hrs
|
||||||
w.Header().Set(model.HeaderEtagServer, etag)
|
w.Header().Set(model.HeaderEtagServer, etag)
|
||||||
w.Write(img)
|
w.Write(img)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1066,8 +1066,8 @@ func TestGetAllTeams(t *testing.T) {
|
|||||||
// Now actually create the policy and assign the team to it
|
// Now actually create the policy and assign the team to it
|
||||||
policy, savePolicyErr := th.App.Srv().Store.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
policy, savePolicyErr := th.App.Srv().Store.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "Policy 1",
|
DisplayName: "Policy 1",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
TeamIDs: []string{policyTeam.Id},
|
TeamIDs: []string{policyTeam.Id},
|
||||||
})
|
})
|
||||||
@@ -1379,8 +1379,8 @@ func TestSearchAllTeams(t *testing.T) {
|
|||||||
// Now actually create the policy and assign the team to it
|
// Now actually create the policy and assign the team to it
|
||||||
policy, savePolicyErr := th.App.Srv().Store.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
policy, savePolicyErr := th.App.Srv().Store.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "Policy 1",
|
DisplayName: "Policy 1",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
TeamIDs: []string{policyTeam.Id},
|
TeamIDs: []string{policyTeam.Id},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ func getDefaultProfileImage(c *Context, w http.ResponseWriter, r *http.Request)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%v, private", 24*60*60)) // 24 hrs
|
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%v, private", model.DayInSeconds)) // 24 hrs
|
||||||
w.Header().Set("Content-Type", "image/png")
|
w.Header().Set("Content-Type", "image/png")
|
||||||
w.Write(img)
|
w.Write(img)
|
||||||
}
|
}
|
||||||
@@ -406,7 +406,7 @@ func getProfileImage(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
if readFailed {
|
if readFailed {
|
||||||
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%v, private", 5*60)) // 5 mins
|
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%v, private", 5*60)) // 5 mins
|
||||||
} else {
|
} else {
|
||||||
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%v, private", 24*60*60)) // 24 hrs
|
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%v, private", model.DayInSeconds)) // 24 hrs
|
||||||
w.Header().Set(model.HeaderEtagServer, etag)
|
w.Header().Set(model.HeaderEtagServer, etag)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ func (a *App) ExtendSessionExpiryIfNeeded(session *model.Session) bool {
|
|||||||
|
|
||||||
// Only extend the expiry if the lessor of 1% or 1 day has elapsed within the
|
// Only extend the expiry if the lessor of 1% or 1 day has elapsed within the
|
||||||
// current session duration.
|
// current session duration.
|
||||||
threshold := int64(math.Min(float64(sessionLength)*0.01, float64(24*60*60*1000)))
|
threshold := int64(math.Min(float64(sessionLength)*0.01, float64(model.DayInMilliseconds)))
|
||||||
// Minimum session length is 1 day as of this writing, therefore a minimum ~14 minutes threshold.
|
// Minimum session length is 1 day as of this writing, therefore a minimum ~14 minutes threshold.
|
||||||
// However we'll add a sanity check here in case that changes. Minimum 5 minute threshold,
|
// However we'll add a sanity check here in case that changes. Minimum 5 minute threshold,
|
||||||
// meaning we won't write a new expiry more than every 5 minutes.
|
// meaning we won't write a new expiry more than every 5 minutes.
|
||||||
|
|||||||
@@ -275,15 +275,16 @@ var ServerTLSSupportedCiphers = map[string]uint16{
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ServiceSettings struct {
|
type ServiceSettings struct {
|
||||||
SiteURL *string `access:"environment_web_server,authentication_saml,write_restrictable"`
|
SiteURL *string `access:"environment_web_server,authentication_saml,write_restrictable"`
|
||||||
WebsocketURL *string `access:"write_restrictable,cloud_restrictable"`
|
WebsocketURL *string `access:"write_restrictable,cloud_restrictable"`
|
||||||
LicenseFileLocation *string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
LicenseFileLocation *string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
||||||
ListenAddress *string `access:"environment_web_server,write_restrictable,cloud_restrictable"` // telemetry: none
|
ListenAddress *string `access:"environment_web_server,write_restrictable,cloud_restrictable"` // telemetry: none
|
||||||
ConnectionSecurity *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
ConnectionSecurity *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
||||||
TLSCertFile *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
TLSCertFile *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
||||||
TLSKeyFile *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
TLSKeyFile *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
||||||
TLSMinVer *string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
TLSMinVer *string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
||||||
TLSStrictTransport *bool `access:"write_restrictable,cloud_restrictable"`
|
TLSStrictTransport *bool `access:"write_restrictable,cloud_restrictable"`
|
||||||
|
// In seconds.
|
||||||
TLSStrictTransportMaxAge *int64 `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
TLSStrictTransportMaxAge *int64 `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
||||||
TLSOverwriteCiphers []string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
TLSOverwriteCiphers []string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
|
||||||
UseLetsEncrypt *bool `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
UseLetsEncrypt *bool `access:"environment_web_server,write_restrictable,cloud_restrictable"`
|
||||||
@@ -1884,17 +1885,18 @@ func (s *ThemeSettings) SetDefaults() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TeamSettings struct {
|
type TeamSettings struct {
|
||||||
SiteName *string `access:"site_customization"`
|
SiteName *string `access:"site_customization"`
|
||||||
MaxUsersPerTeam *int `access:"site_users_and_teams"`
|
MaxUsersPerTeam *int `access:"site_users_and_teams"`
|
||||||
EnableUserCreation *bool `access:"authentication_signup"`
|
EnableUserCreation *bool `access:"authentication_signup"`
|
||||||
EnableOpenServer *bool `access:"authentication_signup"`
|
EnableOpenServer *bool `access:"authentication_signup"`
|
||||||
EnableUserDeactivation *bool `access:"experimental_features"`
|
EnableUserDeactivation *bool `access:"experimental_features"`
|
||||||
RestrictCreationToDomains *string `access:"authentication_signup"` // telemetry: none
|
RestrictCreationToDomains *string `access:"authentication_signup"` // telemetry: none
|
||||||
EnableCustomUserStatuses *bool `access:"site_users_and_teams"`
|
EnableCustomUserStatuses *bool `access:"site_users_and_teams"`
|
||||||
EnableCustomBrand *bool `access:"site_customization"`
|
EnableCustomBrand *bool `access:"site_customization"`
|
||||||
CustomBrandText *string `access:"site_customization"`
|
CustomBrandText *string `access:"site_customization"`
|
||||||
CustomDescriptionText *string `access:"site_customization"`
|
CustomDescriptionText *string `access:"site_customization"`
|
||||||
RestrictDirectMessage *string `access:"site_users_and_teams"`
|
RestrictDirectMessage *string `access:"site_users_and_teams"`
|
||||||
|
// In seconds.
|
||||||
UserStatusAwayTimeout *int64 `access:"experimental_features"`
|
UserStatusAwayTimeout *int64 `access:"experimental_features"`
|
||||||
MaxChannelsPerTeam *int64 `access:"site_users_and_teams"`
|
MaxChannelsPerTeam *int64 `access:"site_users_and_teams"`
|
||||||
MaxNotificationsPerChannel *int64 `access:"environment_push_notification_server"`
|
MaxNotificationsPerChannel *int64 `access:"environment_push_notification_server"`
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ type GlobalRetentionPolicy struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RetentionPolicy struct {
|
type RetentionPolicy struct {
|
||||||
ID string `db:"Id" json:"id"`
|
ID string `db:"Id" json:"id"`
|
||||||
DisplayName string `json:"display_name"`
|
DisplayName string `json:"display_name"`
|
||||||
PostDuration *int64 `json:"post_duration"`
|
PostDurationDays *int64 `db:"PostDuration" json:"post_duration"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RetentionPolicyWithTeamAndChannelIDs struct {
|
type RetentionPolicyWithTeamAndChannelIDs struct {
|
||||||
@@ -46,8 +46,8 @@ type RetentionPolicyWithTeamAndChannelCountsList struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RetentionPolicyForTeam struct {
|
type RetentionPolicyForTeam struct {
|
||||||
TeamID string `db:"Id" json:"team_id"`
|
TeamID string `db:"Id" json:"team_id"`
|
||||||
PostDuration int64 `json:"post_duration"`
|
PostDurationDays int64 `db:"PostDuration" json:"post_duration"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RetentionPolicyForTeamList struct {
|
type RetentionPolicyForTeamList struct {
|
||||||
@@ -56,8 +56,8 @@ type RetentionPolicyForTeamList struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RetentionPolicyForChannel struct {
|
type RetentionPolicyForChannel struct {
|
||||||
ChannelID string `db:"Id" json:"channel_id"`
|
ChannelID string `db:"Id" json:"channel_id"`
|
||||||
PostDuration int64 `json:"post_duration"`
|
PostDurationDays int64 `db:"PostDuration" json:"post_duration"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RetentionPolicyForChannelList struct {
|
type RetentionPolicyForChannelList struct {
|
||||||
|
|||||||
@@ -11,9 +11,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
DayInSeconds = 24 * 60 * 60
|
||||||
|
DayInMilliseconds = DayInSeconds * 1000
|
||||||
|
|
||||||
ExpiredLicenseError = "api.license.add_license.expired.app_error"
|
ExpiredLicenseError = "api.license.add_license.expired.app_error"
|
||||||
InvalidLicenseError = "api.license.add_license.invalid.app_error"
|
InvalidLicenseError = "api.license.add_license.invalid.app_error"
|
||||||
LicenseGracePeriod = 1000 * 60 * 60 * 24 * 10 //10 days
|
LicenseGracePeriod = DayInMilliseconds * 10 //10 days
|
||||||
LicenseRenewalLink = "https://mattermost.com/renew/"
|
LicenseRenewalLink = "https://mattermost.com/renew/"
|
||||||
|
|
||||||
LicenseShortSkuE10 = "E10"
|
LicenseShortSkuE10 = "E10"
|
||||||
@@ -307,7 +310,7 @@ func (l *License) HasEnterpriseMarketplacePlugins() bool {
|
|||||||
// NewTestLicense returns a license that expires in the future and has the given features.
|
// NewTestLicense returns a license that expires in the future and has the given features.
|
||||||
func NewTestLicense(features ...string) *License {
|
func NewTestLicense(features ...string) *License {
|
||||||
ret := &License{
|
ret := &License{
|
||||||
ExpiresAt: GetMillis() + 90*24*60*60*1000,
|
ExpiresAt: GetMillis() + 90*DayInMilliseconds,
|
||||||
Customer: &Customer{},
|
Customer: &Customer{},
|
||||||
Features: &Features{},
|
Features: &Features{},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ func (s *SqlRetentionPolicyStore) Save(policy *model.RetentionPolicyWithTeamAndC
|
|||||||
policyInsertQuery, policyInsertArgs, err := s.getQueryBuilder().
|
policyInsertQuery, policyInsertArgs, err := s.getQueryBuilder().
|
||||||
Insert("RetentionPolicies").
|
Insert("RetentionPolicies").
|
||||||
Columns("Id", "DisplayName", "PostDuration").
|
Columns("Id", "DisplayName", "PostDuration").
|
||||||
Values(policy.ID, policy.DisplayName, policy.PostDuration).
|
Values(policy.ID, policy.DisplayName, policy.PostDurationDays).
|
||||||
ToSql()
|
ToSql()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -214,13 +214,13 @@ func (s *SqlRetentionPolicyStore) Patch(patch *model.RetentionPolicyWithTeamAndC
|
|||||||
|
|
||||||
policyUpdateQuery := ""
|
policyUpdateQuery := ""
|
||||||
policyUpdateArgs := []interface{}{}
|
policyUpdateArgs := []interface{}{}
|
||||||
if patch.DisplayName != "" || patch.PostDuration != nil {
|
if patch.DisplayName != "" || patch.PostDurationDays != nil {
|
||||||
builder := s.getQueryBuilder().Update("RetentionPolicies")
|
builder := s.getQueryBuilder().Update("RetentionPolicies")
|
||||||
if patch.DisplayName != "" {
|
if patch.DisplayName != "" {
|
||||||
builder = builder.Set("DisplayName", patch.DisplayName)
|
builder = builder.Set("DisplayName", patch.DisplayName)
|
||||||
}
|
}
|
||||||
if patch.PostDuration != nil {
|
if patch.PostDurationDays != nil {
|
||||||
builder = builder.Set("PostDuration", *patch.PostDuration)
|
builder = builder.Set("PostDuration", *patch.PostDurationDays)
|
||||||
}
|
}
|
||||||
policyUpdateQuery, policyUpdateArgs, err = builder.
|
policyUpdateQuery, policyUpdateArgs, err = builder.
|
||||||
Where(sq.Eq{"Id": patch.ID}).
|
Where(sq.Eq{"Id": patch.ID}).
|
||||||
@@ -357,7 +357,7 @@ func (s *SqlRetentionPolicyStore) buildGetPoliciesQuery(id string, offset, limit
|
|||||||
Select(`
|
Select(`
|
||||||
RetentionPolicies.Id as "Id",
|
RetentionPolicies.Id as "Id",
|
||||||
RetentionPolicies.DisplayName,
|
RetentionPolicies.DisplayName,
|
||||||
RetentionPolicies.PostDuration,
|
RetentionPolicies.PostDuration as "PostDuration",
|
||||||
A.Count AS ChannelCount,
|
A.Count AS ChannelCount,
|
||||||
B.Count AS TeamCount
|
B.Count AS TeamCount
|
||||||
`).
|
`).
|
||||||
@@ -697,7 +697,7 @@ func (s *SqlRetentionPolicyStore) DeleteOrphanedRows(limit int) (deleted int64,
|
|||||||
|
|
||||||
func (s *SqlRetentionPolicyStore) GetTeamPoliciesForUser(userID string, offset, limit int) ([]*model.RetentionPolicyForTeam, error) {
|
func (s *SqlRetentionPolicyStore) GetTeamPoliciesForUser(userID string, offset, limit int) ([]*model.RetentionPolicyForTeam, error) {
|
||||||
query := s.getQueryBuilder().
|
query := s.getQueryBuilder().
|
||||||
Select(`Teams.Id AS "Id", RetentionPolicies.PostDuration`).
|
Select(`Teams.Id AS "Id", RetentionPolicies.PostDuration AS "PostDuration"`).
|
||||||
From("Users").
|
From("Users").
|
||||||
InnerJoin("TeamMembers ON Users.Id = TeamMembers.UserId").
|
InnerJoin("TeamMembers ON Users.Id = TeamMembers.UserId").
|
||||||
InnerJoin("Teams ON TeamMembers.TeamId = Teams.Id").
|
InnerJoin("Teams ON TeamMembers.TeamId = Teams.Id").
|
||||||
@@ -758,7 +758,7 @@ func (s *SqlRetentionPolicyStore) GetTeamPoliciesCountForUser(userID string) (in
|
|||||||
|
|
||||||
func (s *SqlRetentionPolicyStore) GetChannelPoliciesForUser(userID string, offset, limit int) ([]*model.RetentionPolicyForChannel, error) {
|
func (s *SqlRetentionPolicyStore) GetChannelPoliciesForUser(userID string, offset, limit int) ([]*model.RetentionPolicyForChannel, error) {
|
||||||
query := s.getQueryBuilder().
|
query := s.getQueryBuilder().
|
||||||
Select(`Channels.Id as "Id", RetentionPolicies.PostDuration`).
|
Select(`Channels.Id as "Id", RetentionPolicies.PostDuration as "PostDuration"`).
|
||||||
From("Users").
|
From("Users").
|
||||||
InnerJoin("ChannelMembers ON Users.Id = ChannelMembers.UserId").
|
InnerJoin("ChannelMembers ON Users.Id = ChannelMembers.UserId").
|
||||||
InnerJoin("Channels ON ChannelMembers.ChannelId = Channels.Id").
|
InnerJoin("Channels ON ChannelMembers.ChannelId = Channels.Id").
|
||||||
|
|||||||
@@ -375,14 +375,14 @@ func testPermanentDeleteBatchForRetentionPolicies(t *testing.T, ss store.Store)
|
|||||||
|
|
||||||
channelPolicy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
channelPolicy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "DisplayName",
|
DisplayName: "DisplayName",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
ChannelIDs: []string{channel.Id},
|
ChannelIDs: []string{channel.Id},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
nowMillis := leaveTime + *channelPolicy.PostDuration*24*60*60*1000 + 1
|
nowMillis := leaveTime + *channelPolicy.PostDurationDays*model.DayInMilliseconds + 1
|
||||||
_, _, err = ss.ChannelMemberHistory().PermanentDeleteBatchForRetentionPolicies(
|
_, _, err = ss.ChannelMemberHistory().PermanentDeleteBatchForRetentionPolicies(
|
||||||
nowMillis, 0, limit, model.RetentionPolicyCursor{})
|
nowMillis, 0, limit, model.RetentionPolicyCursor{})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|||||||
@@ -3805,8 +3805,8 @@ func testChannelStoreGetAllChannels(t *testing.T, ss store.Store, s SqlStore) {
|
|||||||
// Exclude policy constrained
|
// Exclude policy constrained
|
||||||
policy, nErr := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
policy, nErr := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "Policy 1",
|
DisplayName: "Policy 1",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
ChannelIDs: []string{c1.Id},
|
ChannelIDs: []string{c1.Id},
|
||||||
})
|
})
|
||||||
@@ -6269,8 +6269,8 @@ func testChannelStoreSearchAllChannels(t *testing.T, ss store.Store) {
|
|||||||
|
|
||||||
_, nErr = ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
_, nErr = ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "Policy 1",
|
DisplayName: "Policy 1",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
ChannelIDs: []string{o14.Id},
|
ChannelIDs: []string{o14.Id},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3063,8 +3063,8 @@ func testPostStorePermanentDeleteBatch(t *testing.T, ss store.Store) {
|
|||||||
t.Run("with data retention policies", func(t *testing.T) {
|
t.Run("with data retention policies", func(t *testing.T) {
|
||||||
channelPolicy, err2 := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
channelPolicy, err2 := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "DisplayName",
|
DisplayName: "DisplayName",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
ChannelIDs: []string{channel.Id},
|
ChannelIDs: []string{channel.Id},
|
||||||
})
|
})
|
||||||
@@ -3083,7 +3083,7 @@ func testPostStorePermanentDeleteBatch(t *testing.T, ss store.Store) {
|
|||||||
_, err2 = ss.Post().Get(context.Background(), post.Id, model.GetPostsOptions{}, "")
|
_, err2 = ss.Post().Get(context.Background(), post.Id, model.GetPostsOptions{}, "")
|
||||||
require.NoError(t, err2, "global policy should have been ignored due to granular policy")
|
require.NoError(t, err2, "global policy should have been ignored due to granular policy")
|
||||||
|
|
||||||
nowMillis := post.CreateAt + *channelPolicy.PostDuration*24*60*60*1000 + 1
|
nowMillis := post.CreateAt + *channelPolicy.PostDurationDays*model.DayInMilliseconds + 1
|
||||||
_, _, err2 = ss.Post().PermanentDeleteBatchForRetentionPolicies(nowMillis, 0, 1000, model.RetentionPolicyCursor{})
|
_, _, err2 = ss.Post().PermanentDeleteBatchForRetentionPolicies(nowMillis, 0, 1000, model.RetentionPolicyCursor{})
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
_, err2 = ss.Post().Get(context.Background(), post.Id, model.GetPostsOptions{}, "")
|
_, err2 = ss.Post().Get(context.Background(), post.Id, model.GetPostsOptions{}, "")
|
||||||
@@ -3092,8 +3092,8 @@ func testPostStorePermanentDeleteBatch(t *testing.T, ss store.Store) {
|
|||||||
// Create a team policy which is stricter than the channel policy
|
// Create a team policy which is stricter than the channel policy
|
||||||
teamPolicy, err2 := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
teamPolicy, err2 := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "DisplayName",
|
DisplayName: "DisplayName",
|
||||||
PostDuration: model.NewInt64(20),
|
PostDurationDays: model.NewInt64(20),
|
||||||
},
|
},
|
||||||
TeamIDs: []string{team.Id},
|
TeamIDs: []string{team.Id},
|
||||||
})
|
})
|
||||||
@@ -3102,7 +3102,7 @@ func testPostStorePermanentDeleteBatch(t *testing.T, ss store.Store) {
|
|||||||
post, err2 = ss.Post().Save(post)
|
post, err2 = ss.Post().Save(post)
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
|
|
||||||
nowMillis = post.CreateAt + *teamPolicy.PostDuration*24*60*60*1000 + 1
|
nowMillis = post.CreateAt + *teamPolicy.PostDurationDays*model.DayInMilliseconds + 1
|
||||||
_, _, err2 = ss.Post().PermanentDeleteBatchForRetentionPolicies(nowMillis, 0, 1000, model.RetentionPolicyCursor{})
|
_, _, err2 = ss.Post().PermanentDeleteBatchForRetentionPolicies(nowMillis, 0, 1000, model.RetentionPolicyCursor{})
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
_, err2 = ss.Post().Get(context.Background(), post.Id, model.GetPostsOptions{}, "")
|
_, err2 = ss.Post().Get(context.Background(), post.Id, model.GetPostsOptions{}, "")
|
||||||
@@ -3144,8 +3144,8 @@ func testPostStorePermanentDeleteBatch(t *testing.T, ss store.Store) {
|
|||||||
|
|
||||||
channelPolicy, err2 := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
channelPolicy, err2 := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "DisplayName",
|
DisplayName: "DisplayName",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
ChannelIDs: []string{c1.Id},
|
ChannelIDs: []string{c1.Id},
|
||||||
})
|
})
|
||||||
@@ -3153,8 +3153,8 @@ func testPostStorePermanentDeleteBatch(t *testing.T, ss store.Store) {
|
|||||||
defer ss.RetentionPolicy().Delete(channelPolicy.ID)
|
defer ss.RetentionPolicy().Delete(channelPolicy.ID)
|
||||||
teamPolicy, err2 := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
teamPolicy, err2 := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "DisplayName",
|
DisplayName: "DisplayName",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
TeamIDs: []string{team.Id},
|
TeamIDs: []string{team.Id},
|
||||||
})
|
})
|
||||||
@@ -3186,7 +3186,7 @@ func testPostStorePermanentDeleteBatch(t *testing.T, ss store.Store) {
|
|||||||
})
|
})
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
|
|
||||||
nowMillis := int64(1 + 30*24*60*60*1000 + 1)
|
nowMillis := int64(1 + 30*model.DayInMilliseconds + 1)
|
||||||
deleted, _, err2 := ss.Post().PermanentDeleteBatchForRetentionPolicies(nowMillis, 2, 1000, model.RetentionPolicyCursor{})
|
deleted, _, err2 := ss.Post().PermanentDeleteBatchForRetentionPolicies(nowMillis, 2, 1000, model.RetentionPolicyCursor{})
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
require.Equal(t, int64(3), deleted)
|
require.Equal(t, int64(3), deleted)
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ func getRetentionPolicyWithTeamAndChannelIds(t *testing.T, ss store.Store, polic
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
policyWithIds := model.RetentionPolicyWithTeamAndChannelIDs{
|
policyWithIds := model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
ID: policyID,
|
ID: policyID,
|
||||||
DisplayName: policyWithCounts.DisplayName,
|
DisplayName: policyWithCounts.DisplayName,
|
||||||
PostDuration: policyWithCounts.PostDuration,
|
PostDurationDays: policyWithCounts.PostDurationDays,
|
||||||
},
|
},
|
||||||
ChannelIDs: make([]string, int(policyWithCounts.ChannelCount)),
|
ChannelIDs: make([]string, int(policyWithCounts.ChannelCount)),
|
||||||
TeamIDs: make([]string, int(policyWithCounts.TeamCount)),
|
TeamIDs: make([]string, int(policyWithCounts.TeamCount)),
|
||||||
@@ -57,7 +57,7 @@ func getRetentionPolicyWithTeamAndChannelIds(t *testing.T, ss store.Store, polic
|
|||||||
func CheckRetentionPolicyWithTeamAndChannelIdsAreEqual(t *testing.T, p1, p2 *model.RetentionPolicyWithTeamAndChannelIDs) {
|
func CheckRetentionPolicyWithTeamAndChannelIdsAreEqual(t *testing.T, p1, p2 *model.RetentionPolicyWithTeamAndChannelIDs) {
|
||||||
require.Equal(t, p1.ID, p2.ID)
|
require.Equal(t, p1.ID, p2.ID)
|
||||||
require.Equal(t, p1.DisplayName, p2.DisplayName)
|
require.Equal(t, p1.DisplayName, p2.DisplayName)
|
||||||
require.Equal(t, p1.PostDuration, p2.PostDuration)
|
require.Equal(t, p1.PostDurationDays, p2.PostDurationDays)
|
||||||
require.Equal(t, len(p1.ChannelIDs), len(p2.ChannelIDs))
|
require.Equal(t, len(p1.ChannelIDs), len(p2.ChannelIDs))
|
||||||
if p1.ChannelIDs == nil || p2.ChannelIDs == nil {
|
if p1.ChannelIDs == nil || p2.ChannelIDs == nil {
|
||||||
require.Equal(t, p1.ChannelIDs, p2.ChannelIDs)
|
require.Equal(t, p1.ChannelIDs, p2.ChannelIDs)
|
||||||
@@ -83,7 +83,7 @@ func CheckRetentionPolicyWithTeamAndChannelIdsAreEqual(t *testing.T, p1, p2 *mod
|
|||||||
func CheckRetentionPolicyWithTeamAndChannelCountsAreEqual(t *testing.T, p1, p2 *model.RetentionPolicyWithTeamAndChannelCounts) {
|
func CheckRetentionPolicyWithTeamAndChannelCountsAreEqual(t *testing.T, p1, p2 *model.RetentionPolicyWithTeamAndChannelCounts) {
|
||||||
require.Equal(t, p1.ID, p2.ID)
|
require.Equal(t, p1.ID, p2.ID)
|
||||||
require.Equal(t, p1.DisplayName, p2.DisplayName)
|
require.Equal(t, p1.DisplayName, p2.DisplayName)
|
||||||
require.Equal(t, p1.PostDuration, p2.PostDuration)
|
require.Equal(t, p1.PostDurationDays, p2.PostDurationDays)
|
||||||
require.Equal(t, p1.ChannelCount, p2.ChannelCount)
|
require.Equal(t, p1.ChannelCount, p2.ChannelCount)
|
||||||
require.Equal(t, p1.TeamCount, p2.TeamCount)
|
require.Equal(t, p1.TeamCount, p2.TeamCount)
|
||||||
}
|
}
|
||||||
@@ -175,8 +175,8 @@ func deleteTeamsAndChannels(ss store.Store, teamIDs, channelIDs []string) {
|
|||||||
func createRetentionPolicyWithTeamAndChannelIds(displayName string, teamIDs, channelIDs []string) *model.RetentionPolicyWithTeamAndChannelIDs {
|
func createRetentionPolicyWithTeamAndChannelIds(displayName string, teamIDs, channelIDs []string) *model.RetentionPolicyWithTeamAndChannelIDs {
|
||||||
return &model.RetentionPolicyWithTeamAndChannelIDs{
|
return &model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: displayName,
|
DisplayName: displayName,
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
TeamIDs: teamIDs,
|
TeamIDs: teamIDs,
|
||||||
ChannelIDs: channelIDs,
|
ChannelIDs: channelIDs,
|
||||||
@@ -255,22 +255,22 @@ func testRetentionPolicyStorePatch(t *testing.T, ss store.Store, s SqlStore) {
|
|||||||
t.Run("modify PostDuration", func(t *testing.T) {
|
t.Run("modify PostDuration", func(t *testing.T) {
|
||||||
patch := &model.RetentionPolicyWithTeamAndChannelIDs{
|
patch := &model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
ID: policy.ID,
|
ID: policy.ID,
|
||||||
PostDuration: model.NewInt64(10000),
|
PostDurationDays: model.NewInt64(10000),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_, err := ss.RetentionPolicy().Patch(patch)
|
_, err := ss.RetentionPolicy().Patch(patch)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
expected := copyRetentionPolicyWithTeamAndChannelIds(policy)
|
expected := copyRetentionPolicyWithTeamAndChannelIds(policy)
|
||||||
expected.PostDuration = patch.PostDuration
|
expected.PostDurationDays = patch.PostDurationDays
|
||||||
checkRetentionPolicyLikeThisExists(t, ss, expected)
|
checkRetentionPolicyLikeThisExists(t, ss, expected)
|
||||||
|
|
||||||
// Store a negative value (= infinity)
|
// Store a negative value (= infinity)
|
||||||
patch.PostDuration = model.NewInt64(-1)
|
patch.PostDurationDays = model.NewInt64(-1)
|
||||||
_, err = ss.RetentionPolicy().Patch(patch)
|
_, err = ss.RetentionPolicy().Patch(patch)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
expected = copyRetentionPolicyWithTeamAndChannelIds(policy)
|
expected = copyRetentionPolicyWithTeamAndChannelIds(policy)
|
||||||
expected.PostDuration = patch.PostDuration
|
expected.PostDurationDays = patch.PostDurationDays
|
||||||
checkRetentionPolicyLikeThisExists(t, ss, expected)
|
checkRetentionPolicyLikeThisExists(t, ss, expected)
|
||||||
|
|
||||||
restoreRetentionPolicy(t, ss, policy)
|
restoreRetentionPolicy(t, ss, policy)
|
||||||
|
|||||||
@@ -259,8 +259,8 @@ func testTeamStoreSearchAll(t *testing.T, ss store.Store) {
|
|||||||
|
|
||||||
_, err = ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
_, err = ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "Policy 1",
|
DisplayName: "Policy 1",
|
||||||
PostDuration: model.NewInt64(20),
|
PostDurationDays: model.NewInt64(20),
|
||||||
},
|
},
|
||||||
TeamIDs: []string{q.Id},
|
TeamIDs: []string{q.Id},
|
||||||
})
|
})
|
||||||
@@ -665,8 +665,8 @@ func testTeamStoreGetAllPage(t *testing.T, ss store.Store) {
|
|||||||
|
|
||||||
policy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
policy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "Policy 1",
|
DisplayName: "Policy 1",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
TeamIDs: []string{o.Id},
|
TeamIDs: []string{o.Id},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -442,14 +442,14 @@ func testThreadStorePermanentDeleteBatchForRetentionPolicies(t *testing.T, ss st
|
|||||||
|
|
||||||
channelPolicy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
channelPolicy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "DisplayName",
|
DisplayName: "DisplayName",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
ChannelIDs: []string{channel.Id},
|
ChannelIDs: []string{channel.Id},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
nowMillis := thread.LastReplyAt + *channelPolicy.PostDuration*24*60*60*1000 + 1
|
nowMillis := thread.LastReplyAt + *channelPolicy.PostDurationDays*model.DayInMilliseconds + 1
|
||||||
_, _, err = ss.Thread().PermanentDeleteBatchForRetentionPolicies(nowMillis, 0, limit, model.RetentionPolicyCursor{})
|
_, _, err = ss.Thread().PermanentDeleteBatchForRetentionPolicies(nowMillis, 0, limit, model.RetentionPolicyCursor{})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
thread, err = ss.Thread().Get(post.Id)
|
thread, err = ss.Thread().Get(post.Id)
|
||||||
@@ -464,14 +464,14 @@ func testThreadStorePermanentDeleteBatchForRetentionPolicies(t *testing.T, ss st
|
|||||||
// Create a team policy which is stricter than the channel policy
|
// Create a team policy which is stricter than the channel policy
|
||||||
teamPolicy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
teamPolicy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "DisplayName",
|
DisplayName: "DisplayName",
|
||||||
PostDuration: model.NewInt64(20),
|
PostDurationDays: model.NewInt64(20),
|
||||||
},
|
},
|
||||||
TeamIDs: []string{team.Id},
|
TeamIDs: []string{team.Id},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
nowMillis = thread.LastReplyAt + *teamPolicy.PostDuration*24*60*60*1000 + 1
|
nowMillis = thread.LastReplyAt + *teamPolicy.PostDurationDays*model.DayInMilliseconds + 1
|
||||||
_, _, err = ss.Thread().PermanentDeleteBatchForRetentionPolicies(nowMillis, 0, limit, model.RetentionPolicyCursor{})
|
_, _, err = ss.Thread().PermanentDeleteBatchForRetentionPolicies(nowMillis, 0, limit, model.RetentionPolicyCursor{})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
_, err = ss.Thread().Get(post.Id)
|
_, err = ss.Thread().Get(post.Id)
|
||||||
@@ -529,14 +529,14 @@ func testThreadStorePermanentDeleteBatchThreadMembershipsForRetentionPolicies(t
|
|||||||
|
|
||||||
channelPolicy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
channelPolicy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "DisplayName",
|
DisplayName: "DisplayName",
|
||||||
PostDuration: model.NewInt64(30),
|
PostDurationDays: model.NewInt64(30),
|
||||||
},
|
},
|
||||||
ChannelIDs: []string{channel.Id},
|
ChannelIDs: []string{channel.Id},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
nowMillis := threadMembership.LastUpdated + *channelPolicy.PostDuration*24*60*60*1000 + 1
|
nowMillis := threadMembership.LastUpdated + *channelPolicy.PostDurationDays*model.DayInMilliseconds + 1
|
||||||
_, _, err = ss.Thread().PermanentDeleteBatchThreadMembershipsForRetentionPolicies(nowMillis, 0, limit, model.RetentionPolicyCursor{})
|
_, _, err = ss.Thread().PermanentDeleteBatchThreadMembershipsForRetentionPolicies(nowMillis, 0, limit, model.RetentionPolicyCursor{})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
_, err = ss.Thread().GetMembershipForUser(userID, post.Id)
|
_, err = ss.Thread().GetMembershipForUser(userID, post.Id)
|
||||||
@@ -548,14 +548,14 @@ func testThreadStorePermanentDeleteBatchThreadMembershipsForRetentionPolicies(t
|
|||||||
// Create a team policy which is stricter than the channel policy
|
// Create a team policy which is stricter than the channel policy
|
||||||
teamPolicy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
teamPolicy, err := ss.RetentionPolicy().Save(&model.RetentionPolicyWithTeamAndChannelIDs{
|
||||||
RetentionPolicy: model.RetentionPolicy{
|
RetentionPolicy: model.RetentionPolicy{
|
||||||
DisplayName: "DisplayName",
|
DisplayName: "DisplayName",
|
||||||
PostDuration: model.NewInt64(20),
|
PostDurationDays: model.NewInt64(20),
|
||||||
},
|
},
|
||||||
TeamIDs: []string{team.Id},
|
TeamIDs: []string{team.Id},
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
nowMillis = threadMembership.LastUpdated + *teamPolicy.PostDuration*24*60*60*1000 + 1
|
nowMillis = threadMembership.LastUpdated + *teamPolicy.PostDurationDays*model.DayInMilliseconds + 1
|
||||||
_, _, err = ss.Thread().PermanentDeleteBatchThreadMembershipsForRetentionPolicies(nowMillis, 0, limit, model.RetentionPolicyCursor{})
|
_, _, err = ss.Thread().PermanentDeleteBatchThreadMembershipsForRetentionPolicies(nowMillis, 0, limit, model.RetentionPolicyCursor{})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
_, err = ss.Thread().GetMembershipForUser(userID, post.Id)
|
_, err = ss.Thread().GetMembershipForUser(userID, post.Id)
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user