Selaa lähdekoodia

添加redis锁2

lang 3 vuotta sitten
vanhempi
commit
e92adf720f
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      Controller/CloudStorage.py

+ 2 - 2
Controller/CloudStorage.py

@@ -1200,9 +1200,9 @@ class CloudStorageView(View):
         lang = request_dict.get('lang', 'en')
 
         redisObj = RedisObject()
-        redisObj.CONN.setnx(uid+'do_experience_order', 1)
+        isLock = redisObj.CONN.setnx(uid+'do_experience_order', 1)
         re.CONN.expire(uid+'do_experience_order', 60)
-        if not res:
+        if not isLock:
             return json(200000, 'Invalid request')
 
         if cdk is not None and pay_type == 11: