@@ -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 | if($siteRateLimits[$row->site_class] > 25) { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $query = $query->get(); |
147 | 147 | |
148 | 148 | if($query->num_rows() > 0) { |
149 | - foreach ($query->result() as $row) { |
|
149 | + foreach($query->result() as $row) { |
|
150 | 150 | $this->handleUpdate($row); |
151 | 151 | } |
152 | 152 | } |
@@ -224,10 +224,10 @@ discard block |
||
224 | 224 | ->get(); |
225 | 225 | |
226 | 226 | $sites = $query->result_array(); |
227 | - foreach ($sites as $site) { |
|
227 | + foreach($sites as $site) { |
|
228 | 228 | $siteClass = $this->sites->{$site['site_class']}; |
229 | 229 | if($titleDataList = $siteClass->doCustomUpdate()) { |
230 | - foreach ($titleDataList as $titleURL => $titleData) { |
|
230 | + foreach($titleDataList as $titleURL => $titleData) { |
|
231 | 231 | $titleURL = (string) $titleURL; //Number only keys get converted to int for some reason, so we need to fix that. |
232 | 232 | print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
233 | 233 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class') |
271 | 271 | ->from('tracker_titles') |
272 | 272 | ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
273 | - ->where('tracker_titles.followed','N') |
|
273 | + ->where('tracker_titles.followed', 'N') |
|
274 | 274 | ->where('tracker_titles !=', '255') |
275 | 275 | ->where('tracker_sites.status', 'enabled') |
276 | 276 | ->where('tracker_sites.use_custom', 'Y') |
@@ -88,7 +88,9 @@ discard block |
||
88 | 88 | sleep(1); |
89 | 89 | } |
90 | 90 | $siteRateLimits[$row->site_class]++; |
91 | - if($siteRateLimits[$row->site_class] > $hardRateLimit) continue; |
|
91 | + if($siteRateLimits[$row->site_class] > $hardRateLimit) { |
|
92 | + continue; |
|
93 | + } |
|
92 | 94 | |
93 | 95 | $this->handleUpdate($row); |
94 | 96 | } |
@@ -196,8 +198,7 @@ discard block |
||
196 | 198 | print " - Something went wrong?\n"; |
197 | 199 | } |
198 | 200 | } |
199 | - } |
|
200 | - else { |
|
201 | + } else { |
|
201 | 202 | //TODO: We should have some way to handle this in the site models. |
202 | 203 | if($row->site_class !== 'MangaKakarot') { |
203 | 204 | log_message('error', "{$row->site_class} | {$row->title} ({$row->title_url}) | Failed to update."); |