1 sec refresh Interval for a 5 sec task

I think it would be much simpler with a server side flag. Alternatively you could check out this thread,