SCHEDULED JOB TO RUN EVERY SECOND ?

sukran
Mega Sage

Is this possible to run schedule job every second ? To check records and trigger a email event queue

 

I tried that but it's missed to do action for some record..

Or how to trim the date //Time field for second value so that we can try to run schedule job every minute...Is this right way ? Plz guide

12 REPLIES 12

Prateek kumar
Mega Sage

Why do you need a job to run every second?


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Alok Das
Tera Guru

Hi Sukran,

Could you please give some more details on the requirement, so that we can come up to the best solution for you. why do you need a schedule job for every second?

Regards,

Alok

Tony Chatfield1
Kilo Patron
Hi, as the others have indicated you should share your business drivers/requirements. Scheduled jobs of any sort that increment in very short time frames are a risk to platform stability/performance degradation and are unnecessary.

sukran
Mega Sage
Hi Everyone Thanks for the response The requirement is that in Change management we have a field name called "planned date "... so the scheduled script needs to check the planned end date time and it should send a alert mail before 30 mins to respective teams That's I have to compare current time and planned date time to execute the script Below script could not trigger event for all records ...sometimes works and some time not Script is var CT = new Glide datetime(gs.nowDateTime()); CT = addSeconds (1800):/ add 30 mins var gr = new Glide record('change_request'); gr.addQuery ('Status Not In 3, 5 ,7'): gr.addQuery('approval , approved); gr.query While (gr.next()) { var rt = gr.end_date.getDisplayValue(); If (CT ==rt) { gs.eventqueue ( notify.enddate , gr ); }