Can't use SystemSettings in Scheduling ?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
gernotlg
Posts: 80
Joined: Fri Aug 27, 2021 1:24 am

Can't use SystemSettings in Scheduling ?

Post by gernotlg »

I take it we can't use SystemSettings to specify a time interval in sheduling ?

The following doesn't seem to trigger the event.

(Where SystemSettings.PODsAutoEmailTime = a number of minutes )

Code: Select all

if NEXT_SEQUENCE_TIME('0.7751654773902943',10,SystemSettings.PODsAutoEmailTime) = 'Yes' AND CURRENT_DATE>=12/01/2024 then AutoEmailNewPODsScheduled
** Add to wishlist !
V8.8 / Windows / MySQL
customaware
Posts: 2405
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Can't use SystemSettings in Scheduling ?

Post by customaware »

I can remember for certain but I vaguely recall that the NEXT_SEQUENCE_TIME does not allow the use of SystemSettings for the parameter.

I use the following which does work with SystemSettings...

/*Check Every 1/120*3600 = 30 Seconds
So, I want to check every 2 minutes....
4/120 * 3600 = 120 seconds
*/

If CURRENT_TIMESTAMP>TIME_ADD(SystemSettings.LastUpdate,4/120) Then
runMyProcess
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Can't use SystemSettings in Scheduling ?

Post by Jaymer »

The simpler thing, in my opinion, is to just call a process and do this complicated check in the process.
The scheduler checks jobs every minute.
So if you have a scheduler task with something like
IF current Date is greater than January 1, 2024, then run processA
It will check that every minute and run the process.
It doesn’t guarantee which second in the minute it will run it, but it will get called/evaluated every minute.
Then, in the process, you could call your desired process, only on even minutes, that way it’s gonna run every two minutes.
Or if you need access to Other variables, put them in that first process instead of the scheduler and you can do just about anything you want.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
gernotlg
Posts: 80
Joined: Fri Aug 27, 2021 1:24 am

Re: Can't use SystemSettings in Scheduling ?

Post by gernotlg »

Thanks guys. Yeah.. I was gonna so something like what Jaymer said. It's not a priority atm though.

Good to know though:
Jaymer wrote: Sun Jan 21, 2024 8:26 pm ....
The scheduler checks jobs every minute.
...
So in essence you could just have One process that runs from the scheduler for tasks you wanna have flexibility on, which then controls when/how often all your actual scheduled tasks are run, where those frequencies/times could then either be stored in SystemSettings, or in a BO.

Not to mention a switch which could turn off all scheduled tasks at once.
V8.8 / Windows / MySQL
Post Reply