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

Storage client supplied via custom configuration is not respected (includes simple fix PR) #2043

Closed
1 task done
BenBeattieHood opened this issue Aug 23, 2023 · 3 comments
Closed
1 task done
Labels
bug Something isn't working.

Comments

@BenBeattieHood
Copy link

BenBeattieHood commented Aug 23, 2023

Which package is this bug report for? If unsure which one to select, leave blank

@crawlee/basic (BasicCrawler)

Issue description

Using the code below, the crawler will continue to save its data using the storage client configured in global config, therefore in this case, in the folder ./storage rather than './our-custom-folder`:

Code sample

    const crawler = new PlaywrightCrawler({
        async requestHandler({ request, page, enqueueLinks, log }) {
             // ...
        }
    },
    new Configuration({
        storageClient: new MemoryStorage({
            localDataDirectory: 'our-custom-folder',
        }),
    }));

Package version

3.5.2

Node.js version

18

Operating system

N/A

Apify platform

  • Tick me if you encountered this issue on the Apify platform

I have tested this on the next release

Yes

Other context

A simple fix for this is available here: BenBeattieHood#1

@BenBeattieHood BenBeattieHood added the bug Something isn't working. label Aug 23, 2023
@B4nan
Copy link
Member

B4nan commented Aug 23, 2023

Thanks, can you open the PR against this repository instead of your fork?

@BenBeattieHood
Copy link
Author

Sorry, I don't have permission to create a branch on this repo. Can you help?

@B4nan
Copy link
Member

B4nan commented Aug 24, 2023

You don't need any permissions to create a PR from your fork, that's the standard way, no need to create a branch on our end.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork

Btw there is one more place that will need the same adjustment, in the BasicCrawler.run method there is another RequestQueue.open() call:

https://github.com/apify/crawlee/blob/master/packages/basic-crawler/src/internals/basic-crawler.ts#L771

@B4nan B4nan closed this as completed in 845141d Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

2 participants