mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Use GetMasterX() to ensure writeability for the RefreshPostStats job (#26986)
This commit is contained in:
@@ -2260,7 +2260,7 @@ func (us SqlUserStore) GetUsersWithInvalidEmails(page int, perPage int, restrict
|
||||
|
||||
func (us SqlUserStore) RefreshPostStatsForUsers() error {
|
||||
if us.DriverName() == model.DatabaseDriverPostgres {
|
||||
if _, err := us.GetReplicaX().Exec("REFRESH MATERIALIZED VIEW poststats"); err != nil {
|
||||
if _, err := us.GetMasterX().Exec("REFRESH MATERIALIZED VIEW poststats"); err != nil {
|
||||
return errors.Wrap(err, "users_refresh_post_stats_exec")
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user