@@ -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 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @return bool |
| 54 | 54 | */ |
| 55 | 55 | protected function controllerIsSetup() { |
| 56 | - if(!is_null($this->crawler_id)) { |
|
| 56 | + if (!is_null($this->crawler_id)) { |
|
| 57 | 57 | return true; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function setupCrawler($crawler_id = null) |
| 69 | 69 | { |
| 70 | - if(!is_null($crawler_id)) { |
|
| 70 | + if (!is_null($crawler_id)) { |
|
| 71 | 71 | $this->setCrawlerId($crawler_id); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if($this->controllerIsSetup()) { |
|
| 74 | + if ($this->controllerIsSetup()) { |
|
| 75 | 75 | $times = config('laravel-job-handler.run_times', 10); |
| 76 | 76 | |
| 77 | 77 | for ($x = 0; $x <= $times; $x++) { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $this->getCrawler(); |
| 80 | 80 | |
| 81 | 81 | if (!$this->crawler->enabled) { |
| 82 | - throw new CrawlerException('Crawler (#' . $this->crawler_id . ') - crawler isnt enabled in database'); |
|
| 82 | + throw new CrawlerException('Crawler (#'.$this->crawler_id.') - crawler isnt enabled in database'); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | $checkIfCrawlerCanBeRunned = $this->canCrawlerRunAfterPeriod(); |
@@ -96,14 +96,14 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | if ($this->crawler->latest_status == 3) { |
| 99 | - throw new CrawlerException('Crawler (#' . $this->crawler_id . ') - last run had an error'); |
|
| 99 | + throw new CrawlerException('Crawler (#'.$this->crawler_id.') - last run had an error'); |
|
| 100 | 100 | } |
| 101 | 101 | } else { |
| 102 | - throw new CrawlerNotReachedTimeBetweenJobsException('Has to wait ' . $checkIfCrawlerCanBeRunned['retry_in'] . ' more seconds to run'); |
|
| 102 | + throw new CrawlerNotReachedTimeBetweenJobsException('Has to wait '.$checkIfCrawlerCanBeRunned['retry_in'].' more seconds to run'); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | if ($x == $times) { |
| 106 | - $this->failCrawler('Crawler (#' . $this->crawler_id . ') - max execution time'); |
|
| 106 | + $this->failCrawler('Crawler (#'.$this->crawler_id.') - max execution time'); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | if ($this->crawler->status == 1) { |