laravel-queue

customising Job and job table in Laravel queue/ rename jobs table

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 09:19:43
问题 When I try php artisan queue:table It gave me the following error [InvalidArgumentException] A CreateJobsTable migration already exists. It is because I have already the migration named CreateJobsTable for other purpose. I cannot rename this table and migration . Is there any way to rename the migration to CreateJobsQueueTable or some thing relevant? can we rename the jobs table that artisan creates with 'queue:table'? 回答1: Yes. Edit this file config\queue.php : <?php return [ ....

customising Job and job table in Laravel queue/ rename jobs table

Deadly 提交于 2019-11-29 14:42:31
When I try php artisan queue:table It gave me the following error [InvalidArgumentException] A CreateJobsTable migration already exists. It is because I have already the migration named CreateJobsTable for other purpose. I cannot rename this table and migration . Is there any way to rename the migration to CreateJobsQueueTable or some thing relevant? can we rename the jobs table that artisan creates with 'queue:table'? Yes. Edit this file config\queue.php : <?php return [ .... 'connections' => [ .... 'database' => [ 'driver' => 'database', 'table' => 'jobs', <------ Edit this to something else

Laravel queue rate limiting or throttling

谁说我不能喝 提交于 2019-11-28 13:53:33
I am working on an app that requires fetching data from a third-party server and that server allows max 1 request per seconds. Now, all request send as job and I am trying to implement Laravel " Rate Limiting " to release 1 job per second but unable to figure out why it should be implemented and there is no real-life example in the web. Did anyone implement it? Any hint of this? Assuming you have only single worker you can do something like this: do what has to be done get time (with microseconds) sleep time that is 1s minus difference between finish time and start time so basically: