以下是使用python redis lua实现的分布式锁 import functools import uuid import time from typing import Callable, Any, Optional import redis # Lua 脚本:原子性获取锁 # KEYS