Skip to main content
12-Amethyst
Nov 1, 2018 4:32 AM UTC
Solved

Re: Timers and Schedulers - Best Practice

Hello Adam,

Thanks for the information it was really useful, but in my case I have 100 things in which I triggered services on 1 second and 1 minute timers so as per your information i have changed execution logic under Timer Thing by calling all the services of a particular things but instead of not going to event system it started increasing the queue Size and it not going down at all.

Have you used this solution and faced the same issue? 

 

Thanks and regards,

Pankaj Phopse

 

12-Amethyst
Dec 27, 2018 9:27 AM UTC

Currently I am not facing any issues with reeference to que size , but now I am facing an diffrent issue.

What I learnt is dont use timer one Second and if you are using any oher timer use Timer thing for execution, as explained in Original Post i.e. best practises for timers and schedulers.

8 replies

12-Amethyst
Nov 1, 2018 4:35 AM UTC

Hello Adam,

Thanks for the information it was really useful, but in my case I have 100 things in which I triggered services on 1 second and 1 minute timers so as per your information i have changed execution logic under Timer Thing by calling all the services of a particular things but instead of not going to event system it started increasing the queue Size and it not going down at all.

Have you used this solution and faced the same issue? 

 

Thanks and regards,

Pankaj Phopse

Translate
22-Sapphire I
Nov 1, 2018 6:04 PM UTC

What type of logic are you executing, and is that logic reading any data from DataTables/Streams/ValueStreams or other data sources?

Translate
12-Amethyst
Nov 2, 2018 3:33 AM UTC

I am not calling or querying any data tables, streams or value streams. In a services i am doing basic calculations like Calclulating line status or calculating KPI like OEE, also for these calculation I have passed the inputs which i have defined in services and passing values from Kepware tags.

Translate
16-Pearl
Nov 2, 2018 6:12 AM UTC

try working with disabling & enabling timer in javascript service with a pause of say 1 sec -- as per your logic

see if that effects the queue size

///////////////////////////////////////////

me.DisableTimer();

logger.warn("in timer event after pause of 1 sec on enable/disable timer");

// your service execution

pause(1000);

me.EnableTimer();

Translate