Update acquire_lock: change 'ex' to 'time'

Brightcells 8 年 前
コミット
23072337d7
共有3 個のファイルを変更した4 個の追加4 個の削除を含む
  1. 2 2
      group/lensman_views.py
  2. 1 1
      group/views.py
  3. 1 1
      requirements.txt

+ 2 - 2
group/lensman_views.py

@@ -176,7 +176,7 @@ def lensman_photo_upload_api(request):
176 176
 
177 177
         group_id = group.group_id
178 178
 
179
-    if photo and r.acquire_lock('{}:{}:{}'.format(group_id, user_id, photo.name), ex=60):
179
+    if photo and r.acquire_lock('{}:{}:{}'.format(group_id, user_id, photo.name), time=60):
180 180
         # 写 PhotosInfo 表
181 181
         m_photo_path, ext = file_save(photo, prefix='photo', ext='jpeg')
182 182
         p_photo_path = 'photo/{}{}'.format(shortuuid.uuid(), ext)
@@ -318,7 +318,7 @@ def lensman_origin_photo_upload_api(request):
318 318
         order.reback_at = tc.utc_datetime()
319 319
         order.save()
320 320
 
321
-    if photo and r.acquire_lock('{}:{}:{}'.format(order_id, user_id, photo.name), ex=60):
321
+    if photo and r.acquire_lock('{}:{}:{}'.format(order_id, user_id, photo.name), time=60):
322 322
         # 写 PhotosInfo 表
323 323
         r_photo_path, ext = file_save(photo, prefix='photo', ext='jpeg')
324 324
 

+ 1 - 1
group/views.py

@@ -253,7 +253,7 @@ def flyimg_upload_api(request):
253 253
     except GroupUserInfo.DoesNotExist:
254 254
         return response(GroupUserStatusCode.GROUP_USER_NOT_FOUND)
255 255
 
256
-    if photo and r.acquire_lock('{}:{}:{}'.format(group_id, user_id, photo.name), ex=60):
256
+    if photo and r.acquire_lock('{}:{}:{}'.format(group_id, user_id, photo.name), time=60):
257 257
         photo_path, ext = file_save(photo, prefix='fly', ext='jpeg')
258 258
         photo_thumbnail_path = photo_path.replace('.', '_thumbnail.')
259 259
         photo_thumbnail2_path = photo_path.replace('.', '_thumbnail2.')

+ 1 - 1
requirements.txt

@@ -28,7 +28,7 @@ mock==2.0.0
28 28
 pep8==1.7.0
29 29
 pywe-oauth==1.0.2
30 30
 records==0.4.3
31
-redis-extensions==1.0.33
31
+redis-extensions==1.0.34
32 32
 requests==2.12.4
33 33
 rlog==0.2
34 34
 shortuuid==0.4.3