From 1ee0841add2097a4f62d4dcbbf118adcb321769b Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 22 Jun 2023 12:49:49 +0300 Subject: [PATCH] Fix function name --- database/historysync.go | 2 +- historysync.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/database/historysync.go b/database/historysync.go index 4d9d0bf..5727a9a 100644 --- a/database/historysync.go +++ b/database/historysync.go @@ -166,7 +166,7 @@ func (hsc *HistorySyncConversation) Scan(row dbutil.Scannable) *HistorySyncConve return hsc } -func (hsq *HistorySyncQuery) GetNMostRecentConversations(userID id.UserID, n int) (conversations []*HistorySyncConversation) { +func (hsq *HistorySyncQuery) GetRecentConversations(userID id.UserID, n int) (conversations []*HistorySyncConversation) { nPtr := &n // Negative limit on SQLite means unlimited, but Postgres prefers a NULL limit. if n < 0 && hsq.db.Dialect == dbutil.Postgres { diff --git a/historysync.go b/historysync.go index 742c9b2..f5535a2 100644 --- a/historysync.go +++ b/historysync.go @@ -108,7 +108,7 @@ func (user *User) handleHistorySyncsLoop() { const EnqueueBackfillsDelay = 30 * time.Second func (user *User) enqueueAllBackfills() { - nMostRecent := user.bridge.DB.HistorySync.GetNMostRecentConversations(user.MXID, user.bridge.Config.Bridge.HistorySync.MaxInitialConversations) + nMostRecent := user.bridge.DB.HistorySync.GetRecentConversations(user.MXID, user.bridge.Config.Bridge.HistorySync.MaxInitialConversations) if len(nMostRecent) > 0 { user.log.Infofln("%v has passed since the last history sync blob, enqueueing backfills for %d chats", EnqueueBackfillsDelay, len(nMostRecent)) // Find the portals for all the conversations. @@ -132,7 +132,7 @@ func (user *User) enqueueAllBackfills() { } func (user *User) backfillAll() { - conversations := user.bridge.DB.HistorySync.GetNMostRecentConversations(user.MXID, -1) + conversations := user.bridge.DB.HistorySync.GetRecentConversations(user.MXID, -1) if len(conversations) > 0 { user.zlog.Info(). Int("conversation_count", len(conversations)).