Page 1 of 2

run a service every minute??

Posted: Sat Jun 15, 2013 4:37 am
by John Herdean

hi, i want to run a gps service every 5 minutes once the service is invoked by a button i created. So, i have made 2 local storage items (one for the longitude ('long') and one for latitude ('lat') to map to. Then i want to run a JS to run the gps service every 5 minutes to update on its own the local storage items, then Im gonna have another REST service to send back those parameters to the server. So i need to run a JS on that service too - the service to be invoked every 5 mins. WHat would the JS code look like for these functions?


run a service every minute??

Posted: Sat Jun 15, 2013 4:45 am
by maxkatz

run a service every minute??

Posted: Sat Jun 15, 2013 4:49 am
by John Herdean

what does '5000' mean in this code?

setTimeout( "restdatasource01.execute({})" , 5000);


run a service every minute??

Posted: Sat Jun 15, 2013 4:51 am
by maxkatz

Time, in milliseconds. setTimeout(..) is a standard JavaScript method. You can find more information about it online.


run a service every minute??

Posted: Sat Jun 15, 2013 4:58 am
by John Herdean

so, then if i want to run this service every 5 minutes it would be like this:

setTimeout( "restdatasource01.execute({})" , 300000);


run a service every minute??

Posted: Sat Jun 15, 2013 4:59 am
by John Herdean

as in 300,000 miliseconds (which should equal 5 minutes since theres 300 seconds in 5 minutes)


run a service every minute??

Posted: Sat Jun 15, 2013 5:13 am
by Illya Stepanov

Hi John - yes you right. This link can help with time conversion :: http://www.unitconversion.org//unit_c...


run a service every minute??

Posted: Sun Jun 16, 2013 5:42 pm
by John Herdean

Hi I was trying to avoid getting the progressbar to keep showing up every 30 seconds (in this case), so I ran this code:

setTimeout( "geolocation1.execute({})" , 30000);
$('#ajaxBusy').remove();

Its ok if the progress bar shows up the first time the button is clicked, but after the service is invoked (by a button) , I dont want the progressbar to appear any longer... But the above code doesnt seem to work... Is there another way to do this or is the JS wrong?


run a service every minute??

Posted: Sun Jun 16, 2013 5:55 pm
by John Herdean

I even ran just this JS on page load, and the progressbar still appeared. Am I missing something here?:

$('#ajaxBusy').remove();


run a service every minute??

Posted: Mon Jun 17, 2013 2:46 am
by maxkatz