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

fix: modify type check to accept Callable (#317) #318

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

junah201
Copy link

This PR updates the type check in the get_user_function function within _function_registry.py to accept callable object instead of only types.FunctionType.

Please refer to #317 for more details.

And I already submit a CLA.

chujchen and others added 3 commits February 14, 2024 13:42
…tform#309)

Previously function framework use 0 timeout which is actually "no timeout" restrction.
 This was causing a problem that when user provides a request timeout to Cloud function, process will still continue and consume resources.
 In this fix, timeout is enabled; default timeout settings is 5 min, same as Cloud run.
 To make sure timeout settings will be respected, default settings switched from multi-threads to multi-workers.

 However, user is still allowed to  customize workers/threads by assigning env var. But user need to note that timeout won't work when #thread > 1.
In the get_user_function function within _function_registry.py, change the type check to accept callable objects instead of only types.FunctionType. This allows for instances of classes with a __call__ method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants