How can I get job details from its ID, ex: 866FvqTxVVvi4PmCo7kHmD7u7bHaxCdn
got that id from queue:listen, thanks
There isn't a built in way of doing this through Laravel. It entirely depends upon which queue driver you are using.
For example, if you are using Redis then you would need to use the Redis CLI to search through the database for the appropriate task.
Related
Is there a way to get a queue job's creation date in laravel while executing the job? My queue driver is redis and I can't change that.
Apparently, there's no built-in way for getting the job creation date in laravel for redis and as #PtrTon stated, you'd have to store that yourself.
I have a list of customers' email and I would like to send promos and news every week.
How do I set this up on AWS using Laravel?
What I currently did was using Laravel's queues something like this:
website.com/api/SendScheduledEmail
So far what I have tried is the crontab on Linux but I don't know how can I visit and execute my URL using it.
you can do as per what #eResourcesInc mentioned whereby you add a scheduled command shown below
$schedule->command('command:send_newsletter')
->daily()
->appendOutputTo(storage_path('logs/send_newsletter.log'));
Documentation here: https://laravel.com/docs/5.8/artisan
If your task has the potential to take a long time/or consume alot of resources. Maybe you can try serverless, like running your task as a function in AWS or Aliyun. More info here: https://vapor.laravel.com
Hope it helps.
I have two apps running on the same server.
Now it seems like when adding withoutOverlapping() to the scheduler job and managing the base cronjob via cron itself, these 2 apps are blocking each other in execution.
Could that be?
Yes, withoutOverlapping only works per application.
Laravel creates a file in the storage folder with a hash of the job. This way, if the file exists, Laravel knows the job is still running. The one application cannot possibly know if the other one is currently running a job because it does not have access to the storage folder of the other application.
If your code looks like the following
$schedule->command('process:queue 0')->everyMinute()->withoutOverlapping();
$schedule->command('process:queue 1')->everyMinute()->withoutOverlapping();
It is because same commands with different parameters might bc considered overlapping.
I.e. the hash of the job will consider only the command signature.
I want to disable the Database Replication from the replica cluster in MarkLogic 8 using ML-Gradle. After updating the configurations, I also want to re-enable it.
There are tasks for enabling and disabling flexrep in ML Gradle. But I couldn't found any such thing for Database Replication. How can this be done?
ml-gradle uses the Management API to handle configuration changes. Database Replication is controlled by sending a PUT command to /manage/v2/databases/[id-or-name]/properties. Update your ml-config/databases/content-database.json file (example that does not include that property) to include database-replication, including replication-enabled: true.
To see what that object should look like, you can send a GET request to the properties endpoint.
You can create your own command to set replication-enabled - see https://github.com/rjrudin/ml-gradle/wiki/Writing-your-own-management-task
I'll also add a ticket for making official commands - e.g. mlEnableReplication and mlDisableReplication, with those defaulting to the content database, and allowing for any database to be specified.
I have a laravel app running and a master slave implementation. the master is used for writing and the slave is used for reading. However how do we work with sessions if we write to session table and grab from sessions table right after user is logged in? Is there anyway we can make certain read requests to the master instead?
If I inderstood the question right, you could use the DB::on method described in: Specifying The Query Connection