<?php

namespace App\Jobs;

use App\Jobs\Tasks\CrawlRssPostTask;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class CrawlRssPostJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $rss_post_id;

    public $timeout = 15;

    /**
     * Create a new job instance.
     */
    public function __construct($rss_post_id)
    {
        $this->rss_post_id = $rss_post_id;
    }

    /**
     * Execute the job.
     */
    public function handle(): void
    {
        CrawlRssPostTask::handle($this->rss_post_id);
    }
}
