summaryrefslogtreecommitdiff
path: root/app/Libraries/Background.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Libraries/Background.php')
-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);