Browse Source

Ensure that statistics are up-to-date before listing

Kristan Kenney 6 years ago
parent
commit
4445b563ed
2 changed files with 9 additions and 0 deletions
  1. 4 0
      bin/v-list-user-stats
  2. 5 0
      bin/v-list-users-stats

+ 4 - 0
bin/v-list-user-stats

@@ -122,6 +122,10 @@ is_object_valid 'user' 'USER' "$user"
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Ensure statistics are up to date
+$BIN/v-update-user-stats $user
+
+
 # Defining config
 conf=$USER_DATA/stats.log
 if [ ! -e "$conf" ]; then

+ 5 - 0
bin/v-list-users-stats

@@ -121,6 +121,11 @@ check_args '0' "$#" '[FORMAT]'
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Ensure statistics are up to date
+for user in $(ls $HESTIA/data/users); do
+    $BIN/v-update-user-stats $user
+done
+
 # Defining config
 conf=$HESTIA/data/users/admin/overall_stats.log
 if [ ! -e "$conf" ]; then