]> 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)
committerThomas Fillon <thomas@parisson.com>
Wed, 20 Sep 2017 10:29:36 +0000 (12:29 +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)
Conflicts:
app/scripts/app.sh

app/scripts/app.sh

index cad8c42b86de36c22fd0d9715e0413a13f612697..0d5bfeb458b316fa93134e20489df88d96aa859a 100644 (file)
@@ -43,9 +43,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
@@ -55,6 +52,9 @@ else
     #     --command='python '$manage' collectstatic --noinput' $src &
     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 \