Skip to content

Commit 5d39956

Browse files
committed
update db counters
1 parent 861585b commit 5d39956

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

bin/v-rebuild-databases

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ is_object_valid 'user' 'USER' "$user"
3333
# Action #
3434
#----------------------------------------------------------#
3535

36+
# Flush counters
37+
U_DATABASES=0
38+
SUSPENDED_DB=0
39+
U_DISK_DB=0
40+
3641
# Starting rebuild loop
3742
for database in $(search_objects 'db' 'SUSPENDED' "no" 'DB'); do
3843

@@ -45,8 +50,17 @@ for database in $(search_objects 'db' 'SUSPENDED' "no" 'DB'); do
4550
pgsql) rebuild_pgsql_database ;;
4651
esac
4752

53+
U_DISK_DB=$((U_DISK_DB + U_DISK))
54+
U_DATABASES=$((U_DATABASES + 1))
55+
if [ "$SUSPENDED" = 'yes' ]; then
56+
SUSPENDED_DB=$((SUSPENDED_DB + 1))
57+
fi
4858
done
4959

60+
update_user_value "$user" '$SUSPENDED_DB' "$SUSPENDED_DB"
61+
update_user_value "$user" '$U_DATABASES' "$U_DATABASES"
62+
update_user_value "$user" '$U_DISK_DB' "$U_DISK_DB"
63+
5064

5165
#----------------------------------------------------------#
5266
# Vesta #

0 commit comments

Comments
 (0)