<?php

namespace App\Jobs;

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

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

    protected $post_id;

    public $timeout = 240;

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

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