3
0
mirror of https://github.com/rvalitov/zabbix-php-fpm.git synced 2023-11-05 03:30:27 +01:00

[add] sort cache and results

This commit is contained in:
Ramil Valitov 2020-07-07 05:37:40 +03:00
parent 2b2dfa435d
commit ab44dad6ec
No known key found for this signature in database
GPG Key ID: 2AB186DABDFE1914
2 changed files with 5 additions and 1 deletions

View File

@ -224,7 +224,8 @@ function discoverAll() {
else else
DATA_COUNT=$(echo "$DATA_COUNT + 1" | bc) DATA_COUNT=$(echo "$DATA_COUNT + 1" | bc)
if [[ $DATA_COUNT -gt 10 ]]; then if [[ $DATA_COUNT -gt 10 ]]; then
echo "Data old: $DATA_OLD, data new: $DATA" echo "Data old: $DATA_OLD"
echo "Data new: $DATA"
return 1 return 1
fi fi
discoverAll "$DATA" "$DATA_COUNT" discoverAll "$DATA" "$DATA_COUNT"

View File

@ -300,6 +300,9 @@ function SavePrintResults() {
PrintDebug "Saving pending pools list to file $PENDING_FILE..." PrintDebug "Saving pending pools list to file $PENDING_FILE..."
${S_PRINTF} "%s\n" "${PENDING_LIST[@]}" >"$PENDING_FILE" ${S_PRINTF} "%s\n" "${PENDING_LIST[@]}" >"$PENDING_FILE"
#We must sort the cache list
readarray -t CACHE < <(for a in "${CACHE[@]}"; do echo "$a"; done | sort)
if [[ -n $DEBUG_MODE ]]; then if [[ -n $DEBUG_MODE ]]; then
PrintDebug "List of pools to be saved to cache pools file:" PrintDebug "List of pools to be saved to cache pools file:"
PrintCacheList PrintCacheList