Skip to main content
12-Amethyst
November 1, 2018
Solved

Re: Timers and Schedulers - Best Practice

  • November 1, 2018
  • 8 replies
  • 4536 views

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

 

Best answer by Pankajphopse1

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
November 1, 2018

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

22-Sapphire I
November 1, 2018

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

12-Amethyst
November 2, 2018

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.

16-Pearl
November 2, 2018

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();