Skip to content

Commit

Permalink
Lint fixes. (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rius authored Oct 17, 2023
1 parent f6a756c commit 29913ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ packaging = ">=19"
# For prometheus metrics
prometheus_client = { version = "^0", optional = true }
# For ZMQBroker
pyzmq = { version = "^23.2.0", optional = true }
pyzmq = { version = "^23.2.0", optional = true, markers = "python_version < '3.12'"}
# For speed
uvloop = { version = ">=0.16.0,<1", optional = true, markers = "sys_platform != 'win32'" }
# For hot-reload.
Expand Down
8 changes: 4 additions & 4 deletions taskiq/cli/worker/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ def interrupt_handler(signum: int, _frame: Any) -> None:
event.set()

if uvloop is not None:
logger.debug("UVLOOP found. Installing policy.")
uvloop.install()
logger.debug("UVLOOP found. Using it as async runner")
loop = uvloop.new_event_loop() # type: ignore
else:
loop = asyncio.new_event_loop()
# This option signals that current
# broker is running as a worker.
# We must set this field before importing tasks,
Expand All @@ -128,8 +130,6 @@ def interrupt_handler(signum: int, _frame: Any) -> None:
receiver_type = get_receiver_type(args)
receiver_kwargs = dict(args.receiver_arg)

loop = asyncio.get_event_loop()

try:
logger.debug("Initialize receiver.")
with ThreadPoolExecutor(args.max_threadpool_threads) as pool:
Expand Down

0 comments on commit 29913ce

Please sign in to comment.