From 90a19057d5508154aecf89b37881c7908801d8e3 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Wed, 3 Aug 2022 18:23:48 -0400 Subject: [PATCH] Restrict files that trigger a reload to files explicitly ending in '.py' that do not start with a dot. This will avoid Emacs lockfiles from triggering the restart. --- tools/docker-compose/awx-autoreload | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker-compose/awx-autoreload b/tools/docker-compose/awx-autoreload index e4a95ec52c..0f6f0b8f9d 100755 --- a/tools/docker-compose/awx-autoreload +++ b/tools/docker-compose/awx-autoreload @@ -11,7 +11,7 @@ last_reload=`date +%s` inotifywait -mrq -e create,delete,attrib,close_write,move --exclude '(/awx_devel/awx/ui|/awx_devel/awx/.*/tests)' $1 | while read directory action file; do this_reload=`date +%s` since_last=$((this_reload-last_reload)) - if [[ "$file" =~ .*py$ ]] && [[ "$since_last" -gt 1 ]]; then + if [[ "$file" =~ ^[^.].*\.py$ ]] && [[ "$since_last" -gt 1 ]]; then echo "File changed: $file" echo "Running command: $2" eval $2