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

[WIP] Experiment with generating all API data statically #311

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

Conversation

wilzbach
Copy link
Member

See #309

A start, probably curl is too slow and this should would need to be done directly in the registry.

TODO:

@dlang-bot
Copy link
Collaborator

Thanks for your pull request, @wilzbach!

@dlang-bot dlang-bot added the WIP label Mar 30, 2018
source/app.d Outdated
@@ -33,7 +33,7 @@ void startMonitoring()
sleep(1.seconds()); // give the cache a chance to warm up first
while(true){
if (s_mirror.length) s_registry.mirrorRegistry(s_mirror);
else s_registry.updatePackages();
Copy link
Member

Choose a reason for hiding this comment

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

uhh you do realize this code is the same as the production code and you removed package updates with this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes of course I do. That's why it's called experiment / WIP. It crashes sometimes when trying to update the registry while wget/curl is fetching. I just wanted to see how far I can get with a simple curl loop.

Anyhow, I can/will remove this once --no-monitoring is a thing (-> #310)

@wilzbach
Copy link
Member Author

7:46:36 AM: Build exceeded maximum allowed runtime

So I guess this would have to use a different approach, like

@WebFreak001
Copy link
Member

how about limiting packages to a select few? I doubt we will need all packages. And whenever packages are needed for a test they can get added (such as when people might want packages with different readme names, with different languages, with different metadata, different logos, different repo types, etc)

@wilzbach
Copy link
Member Author

This is not about previewing PRs, this is about having a static registry mirror on a CDN.

See: #309

@WebFreak001
Copy link
Member

oh ok nvm then, though for netlify PRs I think that would be a good idea

@wilzbach
Copy link
Member Author

though for netlify PRs I think that would be a good idea

FYI: They are already limited because at the moment there's no way to reach a package if not via the main list view and dependencies of such a a package.
As all URLs with query parameters ("?") are ignored, the wget mirror won't do any pagination.

So if you go to https://dub.pm at the moment (that's the static snapshot = to what you see on the previews), only ~ 20 packages are reachable. Maybe a bit more with their dependencies.

@MartinNowak
Copy link
Member

Not sure that's the best move, #309 (comment).
It would also be a big future design liability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants