nodeinfo: stop counting posts and comments dynamically

queries have gotten too heavy, sadly
pull/775/head
Ryan Barrett 2023-12-31 09:04:17 -08:00
rodzic 95e699f5b5
commit 1ce19c2928
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -357,12 +357,13 @@ def nodeinfo():
# 'activeMonth': # 'activeMonth':
# 'activeHalfyear': # 'activeHalfyear':
}, },
'localPosts': Object.query(Object.source_protocol.IN(('web', 'webmention')), # these are too heavy
Object.type.IN(['note', 'article']), # 'localPosts': Object.query(Object.source_protocol.IN(('web', 'webmention')),
).count(), # Object.type.IN(['note', 'article']),
'localComments': Object.query(Object.source_protocol.IN(('web', 'webmention')), # ).count(),
Object.type == 'comment', # 'localComments': Object.query(Object.source_protocol.IN(('web', 'webmention')),
).count(), # Object.type == 'comment',
# ).count(),
}, },
'openRegistrations': True, 'openRegistrations': True,
'metadata': {}, 'metadata': {},