mirror of
https://github.com/N0rthernL1ghts/wordpress.git
synced 2024-11-23 17:42:29 +01:00
Define concurrency limit with variable
This commit is contained in:
parent
aa68d5ba82
commit
c26a0afd1f
|
@ -33,6 +33,7 @@ function main() {
|
||||||
PLUGIN_LIST="${WORDPRESS_PLUGIN_LIST:-}"
|
PLUGIN_LIST="${WORDPRESS_PLUGIN_LIST:-}"
|
||||||
PLUGIN_STRICT_INSTALL="${WORDPRESS_PLUGIN_INSTALL_STRICT:-false}"
|
PLUGIN_STRICT_INSTALL="${WORDPRESS_PLUGIN_INSTALL_STRICT:-false}"
|
||||||
WP_CONTENT_PATH="/var/www/html/wp-content"
|
WP_CONTENT_PATH="/var/www/html/wp-content"
|
||||||
|
CONCURRENCY_LIMIT="${CONCURRENCY_LIMIT:-4}"
|
||||||
|
|
||||||
echo "> Automated WordPress Plugin Installer"
|
echo "> Automated WordPress Plugin Installer"
|
||||||
if [ -z "${PLUGIN_LIST}" ]; then
|
if [ -z "${PLUGIN_LIST}" ]; then
|
||||||
|
@ -60,9 +61,9 @@ function main() {
|
||||||
echo "> Installing plugin '${PLUGIN[0]}' version '${PLUGIN[1]}'"
|
echo "> Installing plugin '${PLUGIN[0]}' version '${PLUGIN[1]}'"
|
||||||
installPlugin "${WP_PLUGIN_INSTALL_ARGS}" &
|
installPlugin "${WP_PLUGIN_INSTALL_ARGS}" &
|
||||||
|
|
||||||
# Run maximum of 2 plugin installs in parallel
|
# Run maximum of X plugin installs in parallel
|
||||||
while [ "$(jobs | wc -l)" -ge 2 ]; do
|
while [ "$(jobs | wc -l)" -ge "${CONCURRENCY_LIMIT}" ]; do
|
||||||
echo " Waiting for batch of 2 plugins to install..."
|
echo " Waiting for batch of ${CONCURRENCY_LIMIT} plugins to install..."
|
||||||
wait
|
wait
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue
Block a user