From 9a995df6154e40e432294cb58ed5763d6bbcdb73 Mon Sep 17 00:00:00 2001 From: Thomas Fillon Date: Wed, 20 Sep 2017 12:23:30 +0200 Subject: [PATCH] Restrict chown fix to depth level 1 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/scripts/app.sh b/app/scripts/app.sh index cad8c42b..0d5bfeb4 100644 --- a/app/scripts/app.sh +++ b/app/scripts/app.sh @@ -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 \ -- 2.39.5