:art: Qiniu Producer

huangqimin001 4 ans auparavant
Parent
Commettre
5fc2a690df
1 fichiers modifiés avec 25 ajouts et 0 suppressions
  1. 25 0
      commands/management/commands/qiniuproducer.py

+ 25 - 0
commands/management/commands/qiniuproducer.py

@@ -0,0 +1,25 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+import logging
4
+
5
+from django_six import CompatibilityBaseCommand
6
+
7
+from integral.models import SaleclerkSubmitLogInfo
8
+from utils.redis.connect import r
9
+
10
+
11
+logger = logging.getLogger('console')
12
+
13
+
14
+class Command(CompatibilityBaseCommand):
15
+    def handle(self, *args, **options):
16
+
17
+        logger.info('Upload image qiniu producer is dealing')
18
+
19
+        sslis = SaleclerkSubmitLogInfo.objects.filter(is_upload_qiniu=False)
20
+
21
+        for ssli in sslis:
22
+            r.rpushjson('QINIU_UPLOAD_LIST', {
23
+               'model': 'SaleclerkSubmitLogInfo',
24
+               'pk': ssli.pk,
25
+            })