Skip to content

Commit

Permalink
Use GetMasterX() to ensure writeability for the RefreshPostStats job (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
devinbinnie authored May 13, 2024
1 parent 838d5cd commit 3fdf4fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/channels/store/sqlstore/user_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3fdf4fc

Please sign in to comment.