Skip to content

Commit fca99bb

Browse files
Fix linter issues
1 parent a76d8d2 commit fca99bb

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/hope_dedup_engine/apps/faces/celery_tasks.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ def encode_chunk(
7373
config: dict[str, Any],
7474
) -> tuple[EncodingType, int, int]:
7575
"""Encode faces in a chunk of files."""
76-
with report_long_execution("DeduplicationSet.objects.get(pk=config.get(\"deduplication_set_id\"))"):
76+
with report_long_execution('DeduplicationSet.objects.get(pk=config.get("deduplication_set_id"))'):
7777
ds = DeduplicationSet.objects.get(pk=config.get("deduplication_set_id"))
7878
try:
7979
callback = partial(notify_status, task=self, dedup_job_id=ds.dedupjob.pk)
8080
with report_long_execution("ds.get_encodings()"):
8181
pre_encodings = ds.get_encodings()
82-
with report_long_execution("encode_faces(files, config.get(\"encoding\"), pre_encodings, progress=callback)"):
82+
with report_long_execution('encode_faces(files, config.get("encoding"), pre_encodings, progress=callback)'):
8383
return encode_faces(files, config.get("encoding"), pre_encodings, progress=callback)
8484
except Exception as e:
8585
sentry_sdk.capture_exception(e)

src/hope_dedup_engine/apps/faces/utils.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ def is_facial_error(value):
2121

2222
DEFAULT_THRESHOLD_SECONDS = 60
2323

24+
2425
@contextmanager
25-
def report_long_execution(message: str, threshold_seconds: int = DEFAULT_THRESHOLD_SECONDS) -> Generator[None, None, None]:
26+
def report_long_execution(
27+
message: str, threshold_seconds: int = DEFAULT_THRESHOLD_SECONDS
28+
) -> Generator[None, None, None]:
2629
start = time.time()
2730
yield
2831
if total := time.time() - start > threshold_seconds:

0 commit comments

Comments
 (0)