Skip to content

Commit bde1d37

Browse files
authored
Update cache.py
1 parent 8ab6c8e commit bde1d37

File tree

1 file changed

+3
-2
lines changed
  • src/clerk_backend_api/jwks_helpers

1 file changed

+3
-2
lines changed

src/clerk_backend_api/jwks_helpers/cache.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import time
2+
from typing import Optional
23

34
class Cache:
45
""" In-memory cache with expiration. """
@@ -7,13 +8,13 @@ def __init__(self):
78
self.cache = {}
89
self.expiration_time = 300 # 5 minutes
910

10-
def set(self, key: str | None, value: str):
11+
def set(self, key: Optional[str], value: str):
1112
if key is None:
1213
return
1314

1415
self.cache[key] = (value, time.time() + self.expiration_time)
1516

16-
def get(self, key: str | None) -> str | None:
17+
def get(self, key: Optional[str]) -> Optional[str]:
1718
if key is None:
1819
return None
1920

0 commit comments

Comments
 (0)