dereuromark / cakephp-queue

Queue plugin for CakePHP - simple, pure PHP and without dependencies.
MIT License
307 stars 136 forks source link

Filling status field #402

Closed rudy1976s closed 7 months ago

rudy1976s commented 7 months ago

Hi Mark

in your following function, found in QueuedJobsTable

public function markJobDone(QueuedJob $job): bool {
        $fields = [
            'progress' => 1,
            'completed' => $this->getDateTime(),
        ];
        $job = $this->patchEntity($job, $fields);

        return (bool)$this->save($job);
    }

is there a particulare reason why the status fields is not filled with status = 1 or something like that? It seems that status field is never updated.

Thank you in advance

Rudy

dereuromark commented 7 months ago

That is a free text field

$table->changeColumn('status', 'string', [
    'length' => 255,
    'null' => true,
    'default' => null,
]);

And can be field with custom input

It is indeed dormant otherwise and unused by the plugin code itself. The docs could be a bit more clear about this.

dereuromark commented 7 months ago

https://github.com/dereuromark/cakephp-queue/pull/189