Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: move retry async check to wrap time#649

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
parthea merged 5 commits intomainfrommove_async_warning
Jun 4, 2024
Merged

Conversation

daniel-sanche
Copy link
Contributor

Werecently made a change to the synchronous version of the Retry class to inspect each output, and raise a warning if the sync Retry class was accidentally used with an async function

This is a useful check, but the implementation adds significant overhead, almost doubling the processing time in a quick benchmark I ran (0.94s -> 1.84s)

This PR moves the check to happen once at wrap time, instead of on each retry attempt. This should give us most of the benefits, without the ongoing performance hit

Note that this implementaiton isn't quite as thouogh as the previous one:iscouroutinefunction won't catch standard functions that happen to return an awaitable, like the previous implementation would. But I think this trade-off is worth it for the performance gain

Fixes#542

@daniel-sanchedaniel-sanche requested review froma team ascode ownersMay 3, 2024 19:51
@product-auto-labelproduct-auto-labelbot added the size: sPull request size is small. labelMay 3, 2024
@partheapartheaenabled auto-merge (squash)June 4, 2024 11:46
@partheaparthea merged commitac098a7 intomainJun 4, 2024
25 checks passed
@partheaparthea deleted the move_async_warning branchJune 4, 2024 11:47
parthea added a commit that referenced this pull requestJun 5, 2024
parthea added a commit that referenced this pull requestJun 5, 2024
@partheaparthea restored the move_async_warning branchJune 5, 2024 16:16
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@partheapartheaparthea approved these changes

Assignees

@partheaparthea

Labels
size: sPull request size is small.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Raise a warning in google.api_core.retry.retry_target if the return value is awaitable
2 participants
@daniel-sanche@parthea

[8]ページ先頭

©2009-2025 Movatter.jp