Skip to content

Commit fe2a5fa

Browse files
rwlock: Switch to uuid4
uuid1 just seems more liable to cause a collision for minimal benefit.
1 parent 85d5a00 commit fe2a5fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redis/rwlock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing import Optional
99
from typing import Self
1010
from typing import Type
11-
from uuid import uuid1
11+
from uuid import uuid4
1212

1313
from typing_extensions import override
1414

@@ -283,7 +283,7 @@ def _writer_semaphore_name(self) -> str:
283283
return f'{self.prefix}:write_semaphore'
284284

285285
def _make_token(self) -> Any:
286-
token = self.redis.get_encoder().encode(uuid1().hex)
286+
token = self.redis.get_encoder().encode(uuid4().hex)
287287
return token
288288

289289
def read(

0 commit comments

Comments
 (0)