Skip to content

Added post filter to avoid parsing the same posts again after restarting the parsing process#262

Open
VladislavBar wants to merge 1 commit intoAlexCSDev:masterfrom
VladislavBar:feat/ignore-already-downloaded-posts
Open

Added post filter to avoid parsing the same posts again after restarting the parsing process#262
VladislavBar wants to merge 1 commit intoAlexCSDev:masterfrom
VladislavBar:feat/ignore-already-downloaded-posts

Conversation

@VladislavBar
Copy link

Basically, I had an issue when the parser would try to fetch again the same content instead of skipping the post entirely.
So, here's my solution for that.

Hopefully, it will work for you as well

@VariableVixen
Copy link

Your filter implementation uses a nested loop (crawledUrls.RemoveAll(x => _ignorePosts.Any(y => y.Id == x.PostId));) which is inefficient. For every single post crawled, the filter will need to iterate every ignored post ID again, and every post downloaded is added to the list of ignored IDs. Have you considered using a HashSet<> instead for the internal implementation?

@VladislavBar
Copy link
Author

Oh... I see. That definitely will be better than iterating over and over again. I'll change it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants