Skip to content

Commit

Permalink
[🔨] Fix bug in sync ratelimit decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
WizzyGeek committed Nov 22, 2021
1 parent 308d671 commit 4c388c4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[tool.poetry]
name = "uprate"
version = "0.2.0"
version = "0.2.1"
description = "Ratelimits. Dumbified. A fully typed, simple ratelimit library."
authors = ["WizzyGeek <[email protected]>"]
license = "MIT"
Expand Down
6 changes: 6 additions & 0 deletions uprate/_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
from .rate import Rate, RateGroup
from .store import H, MemoryStore, T

__all__ = (
"SyncStore",
"SyncMemoryStore",
"SyncRateLimit"
)

G = TypeVar("G")

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion uprate/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
R = TypeVar("R")

__all__ = (
"maybe_awaitable"
"maybe_awaitable",
)

async def maybe_awaitable(ret: Union[R, Awaitable[R]]) -> R:
Expand Down
3 changes: 2 additions & 1 deletion uprate/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ def rated(*args, **kwargs):
if on_retry is None:
raise err from None
else:
on_retry()
on_retry(err)
else:
return func()

return _apply_attrs(rated, limit=limit)

return decorator

0 comments on commit 4c388c4

Please sign in to comment.