Skip to content

Commit

Permalink
fix: Await a coroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
whiterabbit1983 committed Nov 29, 2024
1 parent d20f2e5 commit 9ce2d6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agents-api/agents_api/metrics/counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
@wraps(func)
async def async_wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
metric.labels(kwargs.get(id_field_name, "not_set")).inc()
return func(*args, **kwargs)
return await func(*args, **kwargs)

return async_wrapper if inspect.iscoroutinefunction(func) else wrapper

Expand Down

0 comments on commit 9ce2d6b

Please sign in to comment.