@@ -229,23 +229,23 @@ func (mh *MetricsHandler) TrackConnectionState(signalID string, connected bool)
229229func (mh * MetricsHandler ) updateStats () {
230230 start := time .Now ()
231231 var puppetCount int
232- err := mh .db .QueryRowContext (mh .ctx , "SELECT COUNT(*) FROM puppet" ).Scan (& puppetCount )
232+ err := mh .db .QueryRow (mh .ctx , "SELECT COUNT(*) FROM puppet" ).Scan (& puppetCount )
233233 if err != nil {
234234 mh .log .Warnln ("Failed to scan number of puppets:" , err )
235235 } else {
236236 mh .puppetCount .Set (float64 (puppetCount ))
237237 }
238238
239239 var userCount int
240- err = mh .db .QueryRowContext (mh .ctx , `SELECT COUNT(*) FROM "user"` ).Scan (& userCount )
240+ err = mh .db .QueryRow (mh .ctx , `SELECT COUNT(*) FROM "user"` ).Scan (& userCount )
241241 if err != nil {
242242 mh .log .Warnln ("Failed to scan number of users:" , err )
243243 } else {
244244 mh .userCount .Set (float64 (userCount ))
245245 }
246246
247247 var messageCount int
248- err = mh .db .QueryRowContext (mh .ctx , "SELECT COUNT(*) FROM message" ).Scan (& messageCount )
248+ err = mh .db .QueryRow (mh .ctx , "SELECT COUNT(*) FROM message" ).Scan (& messageCount )
249249 if err != nil {
250250 mh .log .Warnln ("Failed to scan number of messages:" , err )
251251 } else {
@@ -255,7 +255,7 @@ func (mh *MetricsHandler) updateStats() {
255255 var encryptedGroupCount , encryptedPrivateCount , unencryptedGroupCount , unencryptedPrivateCount int
256256 // TODO Use a more precise way to check if a chat_id is a UUID.
257257 // It should also be compatible with both SQLite & Postgres.
258- err = mh .db .QueryRowContext (mh .ctx , `
258+ err = mh .db .QueryRow (mh .ctx , `
259259 SELECT
260260 COUNT(CASE WHEN chat_id NOT LIKE '%-%-%-%-%' AND encrypted THEN 1 END) AS encrypted_group_portals,
261261 COUNT(CASE WHEN chat_id LIKE '%-%-%-%-%' AND encrypted THEN 1 END) AS encrypted_private_portals,
0 commit comments