summaryrefslogtreecommitdiff
path: root/app/Libraries
diff options
context:
space:
mode:
authorhorus2020-09-23 14:33:19 +0200
committerhorus2020-09-23 14:33:19 +0200
commitdc3df89aa73d9df48f92b22378a1307b4ddba3c7 (patch)
treeeeadf2376d69a7c8479db76fcab4a95600dd6716 /app/Libraries
parent82b2360c4f6186feaa43023dcd79fb89d91c9d4d (diff)
downloadsenpai-dc3df89aa73d9df48f92b22378a1307b4ddba3c7.tar.gz
only save stats if no error
Diffstat (limited to 'app/Libraries')
-rw-r--r--app/Libraries/Background.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/Libraries/Background.php b/app/Libraries/Background.php
index 2d63a3e..5334480 100644
--- a/app/Libraries/Background.php
+++ b/app/Libraries/Background.php
@@ -149,9 +149,10 @@ class Background {
echo "Getting stats for " . $entry->mal_id ."\n";
$animeStats = new AnimeStats();
- $animeStats->fill( $entry->mal_id );
-
- $animeStats->save();
+ if ( $animeStats->fill($entry->mal_id) ) {
+ # Only save if no error
+ $animeStats->save();
+ }
# sleep to avoid 403
sleep(5);