mirror of
https://github.com/ansible/awx.git
synced 2026-02-15 10:10:01 -03:30
Make awx-autoreloader work faster for large code changes
This commit is contained in:
@@ -6,10 +6,15 @@ if [ $# -lt 2 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
last_reload=`date +%s`
|
||||||
|
|
||||||
inotifywait -mrq -e create,delete,attrib,close_write,move --exclude '/awx_devel/awx/ui' $1 | while read directory action file; do
|
inotifywait -mrq -e create,delete,attrib,close_write,move --exclude '/awx_devel/awx/ui' $1 | while read directory action file; do
|
||||||
if [[ "$file" =~ .*py$ ]]; then
|
this_reload=`date +%s`
|
||||||
|
since_last=$((this_reload-last_reload))
|
||||||
|
if [[ "$file" =~ .*py$ ]] && [[ "$since_last" -gt 1 ]]; then
|
||||||
echo "File changed: $file"
|
echo "File changed: $file"
|
||||||
echo "Running command: $2"
|
echo "Running command: $2"
|
||||||
eval $2
|
eval $2
|
||||||
|
last_reload=`date +%s`
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user