Fix exact count that caused the RO replicate to fall over...

This commit is contained in:
binwiederhier
2026-09-23 23:13:22 +00:00
parent 10cb6506f8
commit 4f52663dda
3 changed files with 34 additions and 3 deletions
+2 -1
View File
@@ -300,7 +300,8 @@ func (c *Cache) MarkPublished(m *model.Message) error {
return err
}
// MessagesCount returns the total number of messages in the cache
// MessagesCount returns the total number of messages in the cache. On Postgres, this is the
// planner's estimate once the table has been analyzed, not an exact count.
func (c *Cache) MessagesCount() (int, error) {
rows, err := c.db.ReadOnly().Query(c.queries.selectMessagesCount)
if err != nil {