做了一些有限修正
This commit is contained in:
@@ -141,7 +141,8 @@ class TixianZddkshApplyView(APIView):
|
||||
|
||||
user_main = request.user
|
||||
lock_key = f'tixian_audit_apply:{user_main.yonghuid}'
|
||||
if not acquire_lock(lock_key, timeout=10):
|
||||
identifier = acquire_lock(lock_key, timeout=10)
|
||||
if not identifier:
|
||||
return Response({'code': 429, 'msg': '操作频繁,请稍后重试'})
|
||||
|
||||
try:
|
||||
@@ -172,7 +173,7 @@ class TixianZddkshApplyView(APIView):
|
||||
return Response({'code': 0, 'msg': '提现申请已提交,请等待审核', 'data': data})
|
||||
|
||||
finally:
|
||||
release_lock(lock_key)
|
||||
release_lock(lock_key, identifier)
|
||||
|
||||
|
||||
def process_audit_collect(request):
|
||||
@@ -233,7 +234,8 @@ def process_audit_collect(request):
|
||||
return quota_resp
|
||||
|
||||
lock_key = f'tixian_collect:{shenhe_danhao}'
|
||||
if not acquire_lock(lock_key, timeout=15):
|
||||
identifier = acquire_lock(lock_key, timeout=15)
|
||||
if not identifier:
|
||||
return Response({'code': 429, 'msg': '操作频繁,请稍后重试'})
|
||||
|
||||
tixian_id = None
|
||||
@@ -372,7 +374,7 @@ def process_audit_collect(request):
|
||||
})
|
||||
|
||||
finally:
|
||||
release_lock(lock_key)
|
||||
release_lock(lock_key, identifier)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
|
||||
2499
yonghu/views.py
2499
yonghu/views.py
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user