Closed scottgrobinson closed 9 months ago
Hi @scottgrobinson I'm returning from my vacation trip today, I'll look into this tomorrow. Thanks for reporting.
@mateusjunges Thanks for letting me know! I worked around this with a status table for my single job (as it's just the one job I needed this for). I won't specifically need this fix myself but appreciate the update :)
@scottgrobinson In general you don't need to track the runtime of the job as this is already done with the timestamps of the records.
Calculate the runtime with the started_at
and finished_at
timestamp or with created_at
and finished_at
if the job got retried.
Also Laravel Horizon Dashboard gives you more details on runtime, you may be able to load the runtime direct from the Redis Database.
Hi @scottgrobinson sorry for my late response.
Actually, with #33 the __constructor
method expects null or a Model
instance as the first parameter, and a bool
as the second parameter, indicating whether the job should be tracked or not, so you can't pass the two timestamps to the __baseConstruct
method.
Also, what @DimaVIII said is correct, you can calculate the duration of the job using the started_at
and finished_at
fields.
I seem to be struggling to pass variables to my job... Also trying out your PR which is making things better but still having issues (#33)
About this, the PR is not production ready yet, so please don't use it on production before it is released. Since I was on vacations I was not working on it, but I'll get back to it during this week.
Please let me know if there is anything more that I can help you with.
Hello!
I seem to be struggling to pass variables to my job... Also trying out your PR which is making things better but still having issues (https://github.com/mateusjunges/trackable-jobs-for-laravel/pull/33)
I call my job with:
GenerateAudioLogsPlaylist::dispatch($startTimestamp, $endTimestamp)
And my job looks similar to...
I get the following which makes sense because your construct requires two variables trackable/shouldBeTracked), but how do I go about passing in variables?