Skip to content

Commit 5c3710c

Browse files
committed
Cache result of validation
1 parent 3eb9cc1 commit 5c3710c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

librarian_server/api/validate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66

77
import asyncio
8+
from functools import lru_cache
89
from pathlib import Path
910
from time import perf_counter
1011

@@ -38,6 +39,7 @@
3839
router = APIRouter(prefix="/api/v2/validate")
3940

4041

42+
@lru_cache(maxsize=1024)
4143
def calculate_checksum_of_local_copy(
4244
original_checksum: str,
4345
original_size: int,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exclude=["*tests*"]
77
[project]
88
name="hera_librarian"
99
requires-python = ">=3.10"
10-
version = "3.0.11"
10+
version = "3.1.0"
1111
dependencies = [
1212
"alembic",
1313
"argon2-cffi",

0 commit comments

Comments
 (0)