@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | if($query->num_rows() > 0) { |
| 80 | 80 | $hardRateLimit = 500; //This is to avoid any possible IP bans by cache breaking again. |
| 81 | 81 | $siteRateLimits = []; |
| 82 | - foreach ($query->result() as $row) { |
|
| 83 | - if(!array_key_exists($row->site_class,$siteRateLimits)) { |
|
| 82 | + foreach($query->result() as $row) { |
|
| 83 | + if(!array_key_exists($row->site_class, $siteRateLimits)) { |
|
| 84 | 84 | $siteRateLimits[$row->site_class] = 0; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $query = $query->get(); |
| 149 | 149 | |
| 150 | 150 | if($query->num_rows() > 0) { |
| 151 | - foreach ($query->result() as $row) { |
|
| 151 | + foreach($query->result() as $row) { |
|
| 152 | 152 | $this->handleUpdate($row); |
| 153 | 153 | } |
| 154 | 154 | } |
@@ -226,10 +226,10 @@ discard block |
||
| 226 | 226 | ->get(); |
| 227 | 227 | |
| 228 | 228 | $sites = $query->result_array(); |
| 229 | - foreach ($sites as $site) { |
|
| 229 | + foreach($sites as $site) { |
|
| 230 | 230 | $siteClass = $this->sites->{$site['site_class']}; |
| 231 | 231 | if($titleDataList = $siteClass->doCustomUpdate()) { |
| 232 | - foreach ($titleDataList as $titleURL => $titleData) { |
|
| 232 | + foreach($titleDataList as $titleURL => $titleData) { |
|
| 233 | 233 | $titleURL = (string) $titleURL; //Number only keys get converted to int for some reason, so we need to fix that. |
| 234 | 234 | print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
| 235 | 235 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | $query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class') |
| 273 | 273 | ->from('tracker_titles') |
| 274 | 274 | ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
| 275 | - ->where('tracker_titles.followed','N') |
|
| 275 | + ->where('tracker_titles.followed', 'N') |
|
| 276 | 276 | ->where('tracker_titles !=', '255') |
| 277 | 277 | ->where('tracker_sites.status', 'enabled') |
| 278 | 278 | ->where('tracker_sites.use_custom', 'Y') |
@@ -85,7 +85,9 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $siteRateLimits[$row->site_class]++; |
| 88 | - if($siteRateLimits[$row->site_class] > $hardRateLimit) continue; |
|
| 88 | + if($siteRateLimits[$row->site_class] > $hardRateLimit) { |
|
| 89 | + continue; |
|
| 90 | + } |
|
| 89 | 91 | |
| 90 | 92 | if($siteRateLimits[$row->site_class] > 25) { |
| 91 | 93 | // We're doing lots of requests to a single site, so add delays. |
@@ -198,8 +200,7 @@ discard block |
||
| 198 | 200 | print " - Something went wrong?\n"; |
| 199 | 201 | } |
| 200 | 202 | } |
| 201 | - } |
|
| 202 | - else { |
|
| 203 | + } else { |
|
| 203 | 204 | //TODO: We should have some way to handle this in the site models. |
| 204 | 205 | if($row->site_class !== 'MangaKakarot') { |
| 205 | 206 | log_message('error', "{$row->site_class} | {$row->title} ({$row->title_url}) | Failed to update."); |