@@ -36,14 +36,16 @@ protected override async Task DoWork(CancellationToken stoppingToken)
3636 var forumIndex = ( index + 1 ) * 2 ; // counting from one, including both reply and sub reply
3737
3838 _ = await pusher . Ingest . FlushBucketAsync ( $ "{ pusher . CollectionPrefix } replies_content", $ "f{ fid } ") ;
39- var replyContents = from r in db . ReplyContents . AsNoTracking ( ) where r . Fid == fid select r ;
39+ var replyContents = from r in db . ReplyContents . AsNoTracking ( )
40+ where db . Replies . Where ( e => e . Fid == fid ) . Select ( e => e . Pid ) . Contains ( r . Pid ) select r ;
4041 pushedPostCount += PushPostContentsWithTiming ( fid , forumIndex - 1 , forumCount , "replies" ,
4142 replyCount , totalPostCount , pushedPostCount , replyContents ,
4243 r => pusher . PushPost ( fid , "replies" , r . Pid , Helper . ParseThenUnwrapPostContent ( r . ProtoBufBytes ) ) , stoppingToken ) ;
4344 await TriggerConsolidate ( ) ;
4445
4546 _ = await pusher . Ingest . FlushBucketAsync ( $ "{ pusher . CollectionPrefix } subReplies_content", $ "f{ fid } ") ;
46- var subReplyContents = from sr in db . SubReplyContents . AsNoTracking ( ) where sr . Fid == fid select sr ;
47+ var subReplyContents = from sr in db . SubReplyContents . AsNoTracking ( )
48+ where db . SubReplies . Where ( e => e . Fid == fid ) . Select ( e => e . Spid ) . Contains ( sr . Spid ) select sr ;
4749 pushedPostCount += PushPostContentsWithTiming ( fid , forumIndex , forumCount , "sub replies" ,
4850 subReplyCount , totalPostCount , pushedPostCount , subReplyContents ,
4951 sr => pusher . PushPost ( fid , "subReplies" , sr . Spid , Helper . ParseThenUnwrapPostContent ( sr . ProtoBufBytes ) ) , stoppingToken ) ;
0 commit comments