@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('crawler_status_logs', function (Blueprint $table) { |
|
| 16 | + Schema::create('crawler_status_logs', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | |
| 19 | 19 | $table->integer('status_id'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('crawler_statuses', function (Blueprint $table) { |
|
| 16 | + Schema::create('crawler_statuses', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | |
| 19 | 19 | $table->integer('crawler_id'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('crawlers', function (Blueprint $table) { |
|
| 16 | + Schema::create('crawlers', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | |
| 19 | 19 | $table->string('name'); |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | protected $table = 'crawlers'; |
| 14 | 14 | |
| 15 | 15 | protected $fillable = [ |
| 16 | - 'name', |
|
| 17 | - 'description' |
|
| 16 | + 'name', |
|
| 17 | + 'description' |
|
| 18 | 18 | ]; |
| 19 | 19 | |
| 20 | 20 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | parent::boot(); |
| 20 | 20 | |
| 21 | - static::deleting(function ($item) { |
|
| 21 | + static::deleting(function($item) { |
|
| 22 | 22 | $item->logs() |
| 23 | 23 | ->delete(); |
| 24 | 24 | }); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $this->log('Checking if crawler is enabled'); |
| 117 | 117 | if (!$this->crawler->enabled) { |
| 118 | 118 | $this->log('Crawler is not enabled'); |
| 119 | - throw new CrawlerException('Crawler (#' . $this->crawler_id . ') - crawler isnt enabled in database'); |
|
| 119 | + throw new CrawlerException('Crawler (#'.$this->crawler_id.') - crawler isnt enabled in database'); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $this->log('Checking if crawler can be runned'); |
@@ -148,16 +148,16 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | $this->log('Last crawler failed, force run is not enabled'); |
| 151 | - throw new CrawlerException('Crawler (#' . $this->crawler_id . ') - last run had an error and override_fail_status is not enabled'); |
|
| 151 | + throw new CrawlerException('Crawler (#'.$this->crawler_id.') - last run had an error and override_fail_status is not enabled'); |
|
| 152 | 152 | } |
| 153 | 153 | } else { |
| 154 | 154 | $this->log('Crawler needs to wait ('.$checkIfCrawlerCanBeRunned['retry_in'].' seconds) before running again'); |
| 155 | - throw new CrawlerNotReachedTimeBetweenJobsException('Has to wait ' . $checkIfCrawlerCanBeRunned['retry_in'] . ' more seconds to run'); |
|
| 155 | + throw new CrawlerNotReachedTimeBetweenJobsException('Has to wait '.$checkIfCrawlerCanBeRunned['retry_in'].' more seconds to run'); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | if ($x == $times) { |
| 159 | 159 | $this->log('Crawler exceeded the max execution time'); |
| 160 | - $this->failCrawler('Crawler (#' . $this->crawler_id . ') - max execution time'); |
|
| 160 | + $this->failCrawler('Crawler (#'.$this->crawler_id.') - max execution time'); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | if ($this->crawler->status == 1) { |
@@ -248,12 +248,12 @@ discard block |
||
| 248 | 248 | $this->log('Registered status ('.$status.')'); |
| 249 | 249 | |
| 250 | 250 | if ($this->crawler) { |
| 251 | - $this->log('Setting crawler latest status (' . $status . ') attribute'); |
|
| 251 | + $this->log('Setting crawler latest status ('.$status.') attribute'); |
|
| 252 | 252 | |
| 253 | 253 | $this->crawler->latest_status = $status; |
| 254 | 254 | |
| 255 | 255 | $this->crawler->save(); |
| 256 | - $this->log('Set crawler latest status (' . $status . ') attribute'); |
|
| 256 | + $this->log('Set crawler latest status ('.$status.') attribute'); |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | if (!empty($output)) { |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | CrawlerStatusLogs::insert($formatted_logs); |
| 297 | 297 | |
| 298 | - $this->log('Registered crawler logs (count: ' . count($formatted_logs) . ')'); |
|
| 298 | + $this->log('Registered crawler logs (count: '.count($formatted_logs).')'); |
|
| 299 | 299 | } else { |
| 300 | 300 | $this->log('Log output is not set, skipping inserting'); |
| 301 | 301 | } |