| Conditions | 4 |
| Paths | 4 |
| Total Lines | 26 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 40 | public function handle() |
||
| 41 | { |
||
| 42 | $time=Carbon::now(); |
||
| 43 | $this->line("<fg=yellow>[$time] Processing: </>Sync Remote Contest Problem"); |
||
| 44 | |||
| 45 | $contestModel=new ContestModel(); |
||
| 46 | $syncList=$contestModel->runningContest(); |
||
| 47 | foreach ($syncList as $syncContest) { |
||
| 48 | if (isset($syncContest['crawled'])) { |
||
| 49 | if (!$syncContest['crawled']) { |
||
| 50 | $className="App\\Babel\\Extension\\hdu\\Synchronizer"; |
||
| 51 | $all_data=[ |
||
| 52 | 'oj'=>"hdu", |
||
| 53 | 'vcid'=>$syncContest['vcid'], |
||
| 54 | 'gid'=>$syncContest['gid'], |
||
| 55 | 'cid'=>$syncContest['cid'], |
||
| 56 | ]; |
||
| 57 | $hduSync=new $className($all_data); |
||
| 58 | $hduSync->scheduleCrawl(); |
||
| 59 | $contestModel->updateCrawlStatus($syncContest['cid']); |
||
| 60 | } |
||
| 61 | } |
||
| 62 | } |
||
| 63 | |||
| 64 | $time=Carbon::now(); |
||
| 65 | $this->line("<fg=green>[$time] Processed: </>Successfully Synced Remote Contest Problem"); |
||
| 66 | } |
||
| 68 |