Skip to content

Commit

Permalink
check for duplicate actor_names in decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
z0z0r4 authored Aug 6, 2024
1 parent 4b6ad18 commit 931bc02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dramatiq/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def __init__(
priority: int,
options: Dict[str, Any],
) -> None:
if actor_name in broker.actors:
raise ValueError(f"An actor named {actor_name!r} is already registered.")

self.logger = get_logger(fn.__module__, actor_name)
self.fn = async_to_sync(fn) if iscoroutinefunction(fn) else fn
self.broker = broker
Expand Down

0 comments on commit 931bc02

Please sign in to comment.