[RCD] keep-alive changes

Thomas Bruederli thomas at roundcube.net
Tue May 1 14:05:35 CEST 2012


A.L.E.C wrote:
> On 05/01/2012 01:55 PM, A.L.E.C wrote:
>>> I'm not sure if this would run less frequently. It actually has to run with
>>> the minimum interval of all recurring checks which need to be done.
>> The "global action" will be run probably with current interval, but the
>> new keep-alive action will be run less frequently because it would
>> depend only on session_lifetime.
> 
> ... and its execution will be postponed on any user (or our global
> recurring) action.

OK, now I understood entirely what you suggested.

So the implementation would be something like:

  on (<page load>)
    setTimeout(<send keep-alive>, session_lifetime / 2)

  on (<send some ajax request>)
    clearTimeout(<send keep-alive>)

  on (<get ajax response or error>)
    setTimeout(<send keep-alive>, session_lifetime / 2)

~Thomas


More information about the dev mailing list