Closed utdrmac closed 7 months ago
Feel free to fix up the docs
Ideally, I would imagine that the update method converts int to float, since that is a bit nicer to work with https://github.com/dereuromark/cakephp-queue/blob/29cf191fcf97ded7abe6fe9941d375964dc37dad/src/Model/Table/QueuedJobsTable.php#L675 We cannot change that now, so , yes, fixing docs is the best move
https://github.com/dereuromark/cakephp-queue/commit/bced5aa90024fc7c63f72d3956ed5fadef06a44f If there is anything else, feel free to directly PR it.
Ref: https://github.com/dereuromark/cakephp-queue/blob/master/docs/sections/queueing_jobs.md#updating-progressstatus
The first two code examples both use whole/integer number for progress representation:
But then the 3rd code block says
$progress = $job->progress; // A float from 0 to 1
This is not true. If you use an integer in->updateProgress()
, as the examples show, then->progress
is also returned as an integer.The only instance where I've found that
->progress
returns a "float" is when a job completes and the progress is updated insideQueuedJobsTable->markJobDone()
toprogress = 1
.Should the examples be updated to use floats to more accurately represent the end result? (ie: 0.33)