Is there a way to get job creation date in laravel? - laravel

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.

Related

Oracle job alert for DBMS job

I am trying to create an alert for a dbms scheduler job if it is running for a duration longer than expected. For example, if a job that usually takes 2 hours to run is now running for more than 2.5 hours, I want to be notified.
What would be the best way to do this? Can I use Oracle Enterprise Manager for this?
I achieved this by setting the parameter max_run_duration in the dbms job.
An event will be raised if the job run time exceeds the time mentioned in the property.

Laravel: get details about a queue job

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.

Apache Ignite Data refresh

I am using apache ignite to cache my static/reference data from oracle tables.
I have to refresh the data every day at 11:30PM.
Approach 1
Using Apache ignite in-built solution, I did not find a way to refresh the data. Please help me if there is any way?
Approach 2
I used Quartz API to schedule the job, which is working fine. I am using below steps to reload/refresh the data -
Stop the Ignite - Ignition.stopAll(true);
Starting the Ignite - Ignition.start(cfg)
Load the fresh data - In this step I am getting below exception : java.lang.IllegalStateException: Grid is in invalid state to perform this operation. It either not started yet or has already being or have stopped [igniteInstanceName=null, state=STOPPED]
Could you please help me how to fix or choose the best way to adopt ?
It sounds like you can just call loadCache method everyday at 11-30. Quartz can be used to schedule that call.
You may also check out built-in scheduler IgniteScheduler

Laravel master slave exceptions

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

Spring Batch with support of Scheduler

Scenario: The system needs to check the Product table in the database DAILY to check every product's expiration date. The system needs to get a list of products with expiration dates matching the current date. Then, removes these products in the database.
Things to consider:
- Runs a single query to retrieve products that has matching expiration date.
- Remove these products in the database.
- We are talking about thousands of products here.
QUESTION: Is there a need for me to create a Spring Batch Job supported with Scheduler for this or just a Scheduled Job to do this efficiently?
Because in Scheduled Job, I can just schedule the checking and removing daily. And its done. At the same time, I can also do it using Spring Batch with Scheduler. But, what do you think is the more efficient way?
i think spring batch would be a wise decision, if you need to restart your job with more steps inside. otherwise, if it's really just one job, you could solve that restart functionality anyway manually...
all those spring-batch configuration aren't that heavy in your applicationcontext, but you need to create tables for the according repository. (perhaps you gotta stage those tables as well..)
Spring Batch:
if you need restart-functionality
Common Scheduling: Easy and fast, ain't need that much knowledge about the framework

Resources