Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions python/bullmq/utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import asyncio
import json
import traceback
from typing import Any
from typing import Any, Callable, Optional
Comment thread
manast marked this conversation as resolved.
Outdated

import semver


def isRedisVersionLowerThan(current_version, minimum_version):
def isRedisVersionLowerThan(current_version: str, minimum_version: str) -> bool:
Comment thread
manast marked this conversation as resolved.
Outdated
return semver.Version.parse(current_version).compare(minimum_version) == -1
Comment on lines +9 to 12


def extract_result(job_task, emit_callback):
def extract_result(job_task: asyncio.Task, emit_callback: Callable[[str, Any], None]) -> Any:
try:
return job_task.result()
Comment thread
manast marked this conversation as resolved.
Outdated
except Exception as e:
Expand All @@ -19,7 +20,7 @@ def extract_result(job_task, emit_callback):
traceback.print_exc()
emit_callback("error", e)

def get_parent_key(opts: dict[str, str]):
def get_parent_key(opts: dict[str, str]) -> Optional[str]:
if opts:
return f"{opts.get('queue')}:{opts.get('id')}"

Comment thread
manast marked this conversation as resolved.
Outdated
Expand Down
Loading