]> git.parisson.com Git - teleforma.git/commitdiff
reduce failed times, reject if to large
authorGuillaume Pellerin <yomguy@parisson.com>
Sun, 3 Aug 2014 10:32:24 +0000 (12:32 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Sun, 3 Aug 2014 10:32:24 +0000 (12:32 +0200)
teleforma/exam/models.py

index c9733a9e3ad9e014775631d8b65a5e0a25bebb6d..f14442bd36645c829b13c6ab1fcc78e6222fb95d 100644 (file)
@@ -325,7 +325,7 @@ class Script(BaseResource):
 
     def box_upload(self):
         i = 0
-        n = 30
+        n = 10
         s = 6
 
         # self.url = 'http://teleforma.parisson.com/media/scripts/2014/06/24/Gstreamer_monitoring_Pipleline.pdf'
@@ -348,6 +348,10 @@ class Script(BaseResource):
                     time.sleep(s)
                     i += 1
                     if i == n:
+                        if 'too large' in statuses[0]['error']:
+                            self.status = 0
+                            self.reject_reason = 'file too large'
+                            self.reject()
                         break
             else:
                 print 'failed :('