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

feature request: configurations for replacing native fetch #70

Closed
ZeroCho opened this issue Jun 11, 2024 · 4 comments
Closed

feature request: configurations for replacing native fetch #70

ZeroCho opened this issue Jun 11, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ZeroCho
Copy link

ZeroCho commented Jun 11, 2024

Currently, fal-js uses native fetch, but I think it is good to have configurations for changing a default network request function to axios or cross-fetch or got.

Also, I found out that cross-fetch is in package.json but it seems that it is not used in this package. I opened this issue, because I want to use cross-fetch instead of native fetch, because fetch has memory leak issue with datadog service that I'm using.

@drochetti
Copy link
Collaborator

Hey @ZeroCho this is a fair request, I'll look into adding a configurable fetch. We considered it initially, that's why cross-fetch is there, but the lack of control on how different consumers call the service can create a variety of errors we can't control or even easily debug, so that's why we currently lean against it.

I'm curious about the case you mentioned, does Datadog patch the global fetch?

@drochetti drochetti added the enhancement New feature or request label Jun 25, 2024
@ZeroCho
Copy link
Author

ZeroCho commented Jun 25, 2024

@drochetti Thank you for your reply. Yes, datadog patches global fetch and that causes a problem now. So it has a memory leak issue that even after an image generation is finished with fal, a fal agent keeps memory of images. I found out that it was not the problem of fal, but the problem of fetch that datadog patched. That's why I wanna change fetch function.

DataDog/dd-trace-js#4286

@drochetti
Copy link
Collaborator

Hey @ZeroCho this feature was added and already released. See the PR here: #74

I'll close this isse, feel free to reach out if you have any other issues or feedback.

@ZeroCho
Copy link
Author

ZeroCho commented Aug 23, 2024

Thank you! It works like a charm!

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

No branches or pull requests

2 participants