From 79fc6467f3b281a2afc774961ba93758d274c7a5 Mon Sep 17 00:00:00 2001 From: Ruslan Baidan Date: Fri, 13 Jan 2023 14:42:11 +0100 Subject: [PATCH] Turned off the background import by default, added the script to run the import for all clients. --- config/autoload/local.php.dist | 2 +- .../run-background-import-for-all-clients.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 scripts/run-background-import-for-all-clients.sh diff --git a/config/autoload/local.php.dist b/config/autoload/local.php.dist index a1e5b2c..ccbfe8c 100644 --- a/config/autoload/local.php.dist +++ b/config/autoload/local.php.dist @@ -119,6 +119,6 @@ return [ 'import' => [ 'uploadFolder' => $appdir . '/data/import/files', - 'isBackgroundProcessActive' => true, + 'isBackgroundProcessActive' => false, ], ]; diff --git a/scripts/run-background-import-for-all-clients.sh b/scripts/run-background-import-for-all-clients.sh new file mode 100644 index 0000000..4bd283f --- /dev/null +++ b/scripts/run-background-import-for-all-clients.sh @@ -0,0 +1,19 @@ +#! /usr/bin/env bash + +# local use: +#for conf_file_path in /home/vagrant/monarc/config/*/local.php + +for conf_file_path in /var/www/*/local.php +do + config_path=$(dirname "$conf_file_path") + export APP_CONF_DIR=$config_path + + echo "[$(date)] Import analyses for: $config_path." + + # local use: + #./bin/console monarc:import-analyses >> data/background_import.log + + /var/lib/monarc/fo/bin/console monarc:import-analyses >> "$config_path"/data/background_import.log + + echo "[$(date)] Finished." +done