Skip to content

Commit 398c60d

Browse files
committed
memoize session header
1 parent 99a7f58 commit 398c60d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/lpdb/session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from abc import abstractmethod, ABC
22
from datetime import date
3+
from functools import cache
34
from http import HTTPStatus
45
from typing import (
56
Any,
@@ -101,6 +102,7 @@ class AbstractLpdbSession(ABC):
101102
def __init__(self, api_key: str):
102103
self.__api_key = re.sub(r"^ApiKey ", "", api_key)
103104

105+
@cache
104106
def _get_header(self) -> dict[str, str]:
105107
return {
106108
"authorization": f"Apikey {self.__api_key}",

0 commit comments

Comments
 (0)