标签:pre 分布式 except def rgs res return lock *args
def lock_order(fn):
def _warps(*args, **kwargs):
pre = cache.get("lock_order", 0)
if pre:
print "get_order_process is locked---"
return 0
version = str(datetime.now())
cache.set("lock_order", version, 30)
try:
result = fn(*args, **kwargs)
except Exception, e:
print("lock_get_order Exception:%s" % e)
result = -1
cache.delete("lock_order")
return result
return _warps
标签:pre 分布式 except def rgs res return lock *args
原文地址:https://www.cnblogs.com/ilovewuzhaoxia/p/9121027.html