From 6f4c8f0630b6cb094566f9102f7c8cfd8be36239 Mon Sep 17 00:00:00 2001 From: horus Date: Wed, 23 Sep 2020 14:36:50 +0200 Subject: stats_counter --- app/Libraries/Background.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/Libraries') diff --git a/app/Libraries/Background.php b/app/Libraries/Background.php index 5334480..2985f79 100644 --- a/app/Libraries/Background.php +++ b/app/Libraries/Background.php @@ -147,16 +147,21 @@ class Background { } } - echo "Getting stats for " . $entry->mal_id ."\n"; + $stats_counter = 0; $animeStats = new AnimeStats(); + if ( $animeStats->fill($entry->mal_id) ) { # Only save if no error $animeStats->save(); + + $stats_counter++; } # sleep to avoid 403 sleep(5); } + + echo "Got stats for " . $stats_counter . " anime.\n"; } public function checkIfIsAiring() { -- cgit v1.2.3