Skip to content
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

Fixes 500 links loading issue #5662

Conversation

fillingtothemomo
Copy link
Contributor

fixes #5588

What this PR does

Implements continue in wiki_source_pages method in lib/training/wiki_training_loader.rb which is responsible for fetching the links and earlier it was only fetching 500 links and now it fetches till continue parameter becomes nil.

Screenshots

Before:
image
After:
image

@fillingtothemomo
Copy link
Contributor Author

@ragesoss I realized the issue in the previous PR as I was extracting continue parameter from response.data whereas it should have been extracted from response only. I believe now the modules are being loaded fine. Please review the PR.

Comment on lines +96 to +97
# To handle more than 500 pages linked from the source page,
# we'll need to update this to use 'continue'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR implements the use of 'continue' then you should remove/update this comment

# we'll need to update this to use 'continue'.
query_params = { prop: 'links', titles: @wiki_base_page, pllimit: 500 }
response = WikiApi.new(MetaWiki.new).query(query_params)
@query.merge! @continue unless @continue.nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the sense of this line? If @continue is not previously defined then it will be always nil?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fillingtothemomo my previous comment was in relation to the following line:
@query.merge! @continue unless @continue.nil?

what I meant is that if @continue is not previously defined, then that line has no effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabina I looked into continue implementation as in transclusion importer and I didnt see any explicit initialisation of @continue , can you elaborate on that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explain me what the following line does?
@query.merge! @continue unless @continue.nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is supposed to be merging the @continue content into the query unless it is null.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what is the content of @continue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nil currently. I tried with @continue = response['continue'] as well so it wouldn't be null, but didn't succeed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, you have to fix that. What the answer looks like? That should help you understand why @continue = response['continue'] doesn't work.

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.

Fix 500-link limit for loading training slides from wiki
2 participants