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

feat: expose waitUntil for Next.js adapter #797

Open
1 task done
juliusmarminge opened this issue May 10, 2024 · 1 comment
Open
1 task done

feat: expose waitUntil for Next.js adapter #797

juliusmarminge opened this issue May 10, 2024 · 1 comment
Labels
planned We would like this to happen PRs Accepted Anyone feel free to pick this up

Comments

@juliusmarminge
Copy link
Collaborator

juliusmarminge commented May 10, 2024

Describe the feature you'd like to request

https://vercel.com/docs/functions/functions-api-reference#waituntil

I think it’d be useful to have this exposed in the onUploadComplete callback, since you could do some stuff non-blocking (such as delete an old image for example) without blocking server polling response times

Describe the solution you'd like to see

.onUploadComplete(async ({ file, metadata, ctx }) => {
  await db.update(...)
  // delete old file non-blocking
  ctx.waitUntil(() => {
    utapi.deleteFile(metadata.oldFileKey)
  })
})

Additional information

No response

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd be down to file a PR implementing this feature!
@markflorkowski markflorkowski added planned We would like this to happen PRs Accepted Anyone feel free to pick this up labels May 15, 2024
@r0ld3x
Copy link

r0ld3x commented Sep 11, 2024

I can work in this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
planned We would like this to happen PRs Accepted Anyone feel free to pick this up
Projects
None yet
Development

No branches or pull requests

3 participants