]> git.parisson.com Git - telemeta.git/commitdiff
Restrict chown fix to depth level 1
authorThomas Fillon <thomasfillon@users.noreply.github.com>
Wed, 20 Sep 2017 10:23:30 +0000 (12:23 +0200)
committerGitHub <noreply@github.com>
Wed, 20 Sep 2017 10:23:30 +0000 (12:23 +0200)
This should prevent very long recursive checking in production.

Move the code in order to execute that line only for production (and not runserver)

app/scripts/app.sh

index c293c44c2f77ffd285a94919be79827d5012fd84..ab2aba0e83eeaef2412bd8e93538657e58eb0fcf 100644 (file)
@@ -41,9 +41,6 @@ if [ $REINDEX = "True" ]; then
     python $manage rebuild_index --noinput
 fi
 
-# fix media access rights
-find $media -path ${media}import -prune -o -type d -not -user www-data -exec chown www-data:www-data {} \;
-
 # choose dev or prod mode
 if [ "$1" = "--runserver" ]; then
     python $manage runserver 0.0.0.0:8000
@@ -54,6 +51,9 @@ else
 
     python $manage collectstatic --noinput
 
+    # fix media access rights
+    find $media -maxdepth 1 -path ${media}import -prune -o -type d -not -user www-data -exec chown www-data:www-data {} \;
+
     # app start
     uwsgi --socket :$port --wsgi-file $wsgi --chdir $app --master \
         --processes $processes --threads $threads \