imTigger / laravel-job-status

Add ability to track Job progress, status and result dispatched to Queue.
MIT License
407 stars 60 forks source link

$this->setProgressMax() not woking? #49

Closed kiddtang closed 4 years ago

kiddtang commented 4 years ago

Anybody encounter this? $this->setProgressMax($max); has no effect on job_statuses table.

Anything necessary missing out ?


use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, Trackable;

...
public function __construct($params)
{
    $this->prepareStatus();
}
...
 public function handle()
{
    $this->setProgressMax(100);

    ...

    foreach( ... )
    {
         ...
         $progress_now += 1;
         $this->setProgressNow($progress_now);
    }
}
imTigger commented 4 years ago

Is update called within transaction? If so, please upgrade to 1.1.0 and setup transaction support.

kiddtang commented 4 years ago

@imTigger i think i might solve the issue. It could the redis cache prefix issue which mixed up the horizon jobs with my other project. Thanks!