Add (news bites)
This commit is contained in:
38
app/Jobs/BrowseRSSPostJob.php
Normal file
38
app/Jobs/BrowseRSSPostJob.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class BrowseRSSPostJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public $timeout = 20;
|
||||
|
||||
protected $hours;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct($hours)
|
||||
{
|
||||
$this->hours = $hours;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$rss_urls = config('platform.global.rss');
|
||||
|
||||
foreach ($rss_urls as $rss_url) {
|
||||
BrowseSingleRSSJob::dispatch($rss_url, $this->hours);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user