From 7af7b2c8c2f55a2b4475187d34ed6a4e2608249b Mon Sep 17 00:00:00 2001 From: bruno Date: Tue, 27 Oct 2026 22:57:36 -0400 Subject: [PATCH] [fix] Corrections ruff CI (UP017/UP041/UP012/I001/F401/FURB162) : backend/indexer.py --- backend/indexer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/indexer.py b/backend/indexer.py index d5ae560..5f8cf71 100644 --- a/backend/indexer.py +++ b/backend/indexer.py @@ -5,7 +5,7 @@ import os import re import threading from collections.abc import Callable -from datetime import datetime, timezone +from datetime import UTC, datetime from pathlib import Path from typing import Any @@ -581,7 +581,7 @@ def _scan_vault( try: relative = fpath.relative_to(vault_root) stat = fpath.stat() - modified = datetime.fromtimestamp(stat.st_mtime, tz=timezone.utc).isoformat() + modified = datetime.fromtimestamp(stat.st_mtime, tz=UTC).isoformat() # #86 differential scan: reuse the previous entry when neither # size nor mtime changed — skips the disk read + parse below. @@ -866,7 +866,7 @@ async def build_index(progress_callback=None) -> None: # Record timestamp of full index rebuild global _last_full_index_ts - _last_full_index_ts = datetime.now(timezone.utc).isoformat() + _last_full_index_ts = datetime.now(UTC).isoformat() # Build attachment index from backend.attachment_indexer import build_attachment_index @@ -1033,7 +1033,7 @@ def _index_single_file_sync(vault_name: str, vault_path: str, file_path: str, va return None stat = fpath.stat() - modified = datetime.fromtimestamp(stat.st_mtime, tz=timezone.utc).isoformat() + modified = datetime.fromtimestamp(stat.st_mtime, tz=UTC).isoformat() # PDF handling — binary, must go through pdf_reader (same as _scan_vault) tags: list[str] = []