Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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