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

Errors on start with many repos #45

Open
motionsuggests opened this issue Oct 26, 2022 · 2 comments
Open

Errors on start with many repos #45

motionsuggests opened this issue Oct 26, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@motionsuggests
Copy link
Contributor

I have a docusaurus config with 20+ instances of this plugin with a varying amount of documents for each. On start it errors out.

Error

[ERROR] Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)

I'm using Constant Sync mode.

Sample of one of the configs:

'docusaurus-plugin-remote-content',
{
    // options here
    name: 'unique.name',
    sourceBaseUrl: 'github.enterprise.url', // some are public github urls
    outDir: 'docs/unique.name',
    documents: [
      'README.md',
      'docs/QuickStart.md',
    ], // most have one or two files and a couple have 15+ files
    modifyContent(filename, content) {
      // flattening the docs/ files and fixing some urls
    }
}

My guess is that this many connections isn't compatible with Constant Sync mode because of the number of connections.

My current work around is to use CLI Sync mode.

@RDIL RDIL added the bug Something isn't working label Oct 26, 2022
@RDIL RDIL self-assigned this Oct 26, 2022
@RDIL
Copy link
Member

RDIL commented Oct 26, 2022

Uh oh, that's not good. Didn't think this would ever be the case, as all documents are fetched at the same time, but I forgot about multiple instances of the plugin. I'll try to add a queue system later this week.

@motionsuggests
Copy link
Contributor Author

I've got solution that works motionsuggests/docusaurus-plugin-remote-content@main...motionsuggests:docusaurus-plugin-remote-content:axios-interceptors

It's a bit ugly. It uses axios interceptors to manage a queue. https://axios-http.com/docs/interceptors.

I'm looking to do another version using a proper queue https://github.com/sindresorhus/p-queue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants