@@ -173,6 +173,8 @@ federation
173
173
] ;
174
174
} ) ;
175
175
176
+ const followersLogger = getLogger ( [ "hollo" , "federation" , "followers" ] ) ;
177
+
176
178
federation
177
179
. setFollowersDispatcher (
178
180
"/@{identifier}/followers" ,
@@ -181,6 +183,10 @@ federation
181
183
where : eq ( accountOwners . handle , identifier ) ,
182
184
} ) ;
183
185
if ( owner == null ) return null ;
186
+ followersLogger . debug (
187
+ "Gathering followers for {identifier} with cursor {cursor} and filter {filter}..." ,
188
+ { identifier, cursor, filter } ,
189
+ ) ;
184
190
const offset = cursor == null ? undefined : Number . parseInt ( cursor ) ;
185
191
if ( offset != null && ! Number . isInteger ( offset ) ) return null ;
186
192
const followers = await db . query . accounts . findMany ( {
@@ -206,7 +212,7 @@ federation
206
212
limit : offset == null ? undefined : 41 ,
207
213
} ) ;
208
214
const items = offset == null ? followers : followers . slice ( 0 , 40 ) ;
209
- return {
215
+ const result = {
210
216
items : items . map ( ( f ) => ( {
211
217
id : new URL ( f . iri ) ,
212
218
inboxId : new URL ( f . inboxUrl ) ,
@@ -217,6 +223,11 @@ federation
217
223
nextCursor :
218
224
offset != null && followers . length > 40 ? `${ offset + 40 } ` : null ,
219
225
} ;
226
+ followersLogger . debug (
227
+ "Gathered {followers} followers for {identifier} with cursor {cursor} and filter {filter}." ,
228
+ { followers : result . items . length , identifier, cursor, filter } ,
229
+ ) ;
230
+ return result ;
220
231
} ,
221
232
)
222
233
. setFirstCursor ( async ( _ctx , _identifier ) => "0" )
@@ -421,7 +432,7 @@ federation.setFeaturedTagsDispatcher(
421
432
} ,
422
433
) ;
423
434
424
- const inboxLogger = getLogger ( [ "hollo" , "inbox" ] ) ;
435
+ const inboxLogger = getLogger ( [ "hollo" , "federation" , " inbox"] ) ;
425
436
426
437
federation
427
438
. setInboxListeners ( "/@{identifier}/inbox" , "/inbox" )
0 commit comments