]> git.parisson.com Git - teleforma.git/commitdiff
increase cache to 24h, add time interval for conf publication, no container port...
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Thu, 30 Jun 2022 15:44:47 +0000 (17:44 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Thu, 30 Jun 2022 15:44:47 +0000 (17:44 +0200)
app/settings.py
bin
docker-compose.yml
env/prod.yml
teleforma/management/commands/teleforma-publish-notify-conferences.py

index c1c6113ef4bf78103e66cc09dac7e6e69471294f..26cfc8d3c25b3c0d8e5bfec9b169cd3635af5ad0 100644 (file)
@@ -302,7 +302,7 @@ CACHES = {
    }
 }
 
-CACHE_TIMEOUT = 60*60*12
+CACHE_TIMEOUT = 60*60*24
 
 # Name of cache backend to cache user agents. If it not specified default
 # cache alias will be used. Set to `None` to disable caching.
diff --git a/bin b/bin
index 52d01bc8d0ec34d96ae3751fa5709a8ae05066fd..7a7c9ab66099c6e93acacf48d589bfc9da5a9fc2 160000 (submodule)
--- a/bin
+++ b/bin
@@ -1 +1 @@
-Subproject commit 52d01bc8d0ec34d96ae3751fa5709a8ae05066fd
+Subproject commit 7a7c9ab66099c6e93acacf48d589bfc9da5a9fc2
index aeb7112b18beeb1273fac2c0582284c5fc8b80cb..21a93f218cc7a75488866c8dc390a49ccdb83b77 100644 (file)
@@ -70,8 +70,6 @@ services:
       - ./teleforma/:/srv/src/teleforma/teleforma
       - ./var/log/app:/var/log/app
       - ./var/run/app:/var/run/app
-    ports:
-      - "9002:8000"
     links:
       - db
       - redis
index 88af99bed2aab8c5a8c4938d6ef65a64096a403d..00467d66c69f9f7212073b5200add3e61eaa4a7a 100644 (file)
@@ -13,8 +13,6 @@ services:
     volumes:
       - /mnt/crfpa-videos:/mnt/crfpa-videos
       - /mnt/crfpa-scripts:/mnt/crfpa-scripts
-    ports:
-      - "9003:8000"
     networks:
       - teleforma-prod
   
@@ -30,8 +28,6 @@ services:
       - ./lib:/srv/lib
       - ./teleforma/:/srv/src/teleforma/teleforma
       - ./var/log/app:/var/log/app
-    ports:
-      - "9004:8000"
     env_file:
       - env/prod.env
     networks:
@@ -69,4 +65,4 @@ volumes:
 
 networks:
   teleforma-prod:
-    driver: bridge
\ No newline at end of file
+    driver: bridge
index 4b9aafda852de1028d404014254350b91df1bb5d..8140c7b73dfa63404b35ccd0293aaab167ccf048 100644 (file)
@@ -48,20 +48,32 @@ class Command(BaseCommand):
         period_name = options['period']
         period = Period.objects.get(name=period_name)
 
+        now_minus = datetime.datetime.now() - datetime.timedelta(minutes=5)
+        print(now_minus)
+        now_plus = datetime.datetime.now() + datetime.timedelta(minutes=1)
+        print(now_plus)
+
         conferences = Conference.objects.filter(
                         period=period,
                         status=2,
                         notified=False,
-                        date_publish__lte=datetime.datetime.now()
+                        date_publish__lte=now_plus,
+                        date_publish__gte=now_minus,
                         )
 
         for conference in conferences:
             conference.status = 3
             conference.save()
+            medias = conference.media.all()
+            for media in medias:
+                media.is_published = True
+                media.save()
+                if "video/mp4" in media.mime_type:
+                    linked_media = media
             logger.logger.info("Conference published: " + conference.public_id)
          
             media = conference.media.filter(mime_type='video/mp4')[0]
-            url = reverse('teleforma-media-detail', args=[conference.period.id, media.id])
+            url = reverse('teleforma-media-detail', args=[conference.period.id, linked_media.id])
             message = "Nouvelle conférence publiée : " + str(conference)
 
             students = Student.objects.filter(period=conference.period)