timerFired not being called

Post Reply
davet2
Newbie
Posts: 5
Joined: Mon Jul 21, 2014 11:14 am

timerFired not being called

Post by davet2 »

I'm running a developer licence of Switch12 (not that it should matter for this problem) for Windows, and I can't get the timerFired function to be called.



I've a lot of scripts that use it successfully in Switch11, but now we're looking at upgrading I thought it would be best to test!



Even a very simple function such as this:

function timerFired( s : Switch )

{

s.setTimerInterval(60);

s.log(1,"test");

}



Does nothing when put in a flow (testing in the SwitchScripter application produces the results). Is this a bug or have I missed something in the newest version?



Finally, the 'log debug messages' has been removed - this is a very useful log that we often use to debug issues. Will this be added back?
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

timerFired not being called

Post by dkelly »

I believe you are resetting the timer each time. Try this:



function timerFired( s : Switch )

{

if (s.getTimerInterval() == 0)

s.setTimerInterval(60);

s.log(1,"test");

}





Dwight Kelly

Apago, Inc.
davet2
Newbie
Posts: 5
Joined: Mon Jul 21, 2014 11:14 am

timerFired not being called

Post by davet2 »

Thanks for the suggestion, but it still does nothing. There is never any entry in the log with 'test'.



Guess it's a bug then.
davet2
Newbie
Posts: 5
Joined: Mon Jul 21, 2014 11:14 am

timerFired not being called

Post by davet2 »

Ok, it was being called after all - turns out that the original script I was testing had an error in it. But I couldn't catch the error because the log level 1 doesn't seem to do anything anymore. If I change it to level 2 or 3 then I get my logging to work.



So still a bug, but a smaller one than I previously thought.
freddyp
Advanced member
Posts: 1023
Joined: Thu Feb 09, 2012 3:53 pm

timerFired not being called

Post by freddyp »

I see you have already found the "solution", but I would still like to send this tardy confirmation (I was away last week): s.log with level 1 and with level -1 does not log anything anymore since Switch 12. This is a result of the fact that we drastically reduced the number of messages being generated by Switch.



So that is how I also do it since: I use level 2 during the testing of the script in a flow (in Switch Scripter level 1 still generates messages) and once I see all is well, I comment out the log lines.



Freddy
davet2
Newbie
Posts: 5
Joined: Mon Jul 21, 2014 11:14 am

timerFired not being called

Post by davet2 »

Freddy,



Thanks for the confirmation - it's a shame that the info logging has been removed. I think it should be up to the users to be able to log this or not. I can understand that it doesn't log as much in the main gui but from a system point of view I can't see whats going on (which is a big problem for me and will mean that I won't be upgrading any of our systems). As a sysadmin we need the logs for accountability - users can complain that files didn't get processed/sent and now we have no proof of this.



And the removal of the debug log option is a big step back too.
compendio
Member
Posts: 22
Joined: Tue Feb 28, 2012 9:45 am

timerFired not being called

Post by compendio »

Check the http://www.enfocus.com/en/support/knowl ... switch-12/ and search for "Reduced number of Messages"
davet2
Newbie
Posts: 5
Joined: Mon Jul 21, 2014 11:14 am

timerFired not being called

Post by davet2 »

It turns out that all the messages are still being logged, just not shown in the GUI. They're available when outputting the logs to text files (or by looking in the internal log DB) - so now I just get out the logs from the internal DB and put them all in an external MySQL database instead. Really annoying when trying to quickly debug something though.
Post Reply