-
Notifications
You must be signed in to change notification settings - Fork 45
fix cache population hanging #648
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
Conversation
🦋 Changeset detectedLatest commit: 12b30cd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
const proxy = await getPlatformProxy<CloudflareEnv>(populateCacheOptions); | ||
const prefix = proxy.env[R2_CACHE_PREFIX_ENV_NAME]; // Set the cache type to R2 for the current environment | ||
await proxy.dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 nits:
- Maybe extract this into
async getEnvFromPlatformProxy()
? - Only call it after line 109 (i.e. skip if not needed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe extract this into async getEnvFromPlatformProxy()
I was thinking actually that we could use the proxy bindings when target is local. I just tested that and it's like a 60 times speed up WDYT ?
Probably in another PR though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can create an issue for now.
I think implementing batch population in wrangler would be better as it could benefit other projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a few nits.
I'm curious about what pointed you into that direction / how confident are you that the PR fixes the issue?
I knew it was probably something related to wrangler process, so it was either the wrangler update or the proxy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a commit to refine the typing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a commit to refine the typing
Should fix #647