mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
* Calendar/eSync: fixed caching causing new events on EGroupware side not to appear on device (withing time of a running ping-request)
This commit is contained in:
parent
8147adcb95
commit
a8e8f33ff4
@ -317,6 +317,11 @@ class calendar_so
|
||||
return $events;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximum time a ctag get cached, as ActiveSync ping requests can run for a long time
|
||||
*/
|
||||
const MAX_CTAG_CACHE_TIME = 300;
|
||||
|
||||
/**
|
||||
* Get maximum modification time of events for given participants and optional owned by them
|
||||
*
|
||||
@ -330,6 +335,12 @@ class calendar_so
|
||||
function get_ctag($users, $owner_too=false,$master_only=false)
|
||||
{
|
||||
static $ctags = array(); // some per-request caching
|
||||
static $last_request = null;
|
||||
if (!isset($last_request) || time()-$last_request > self::MAX_CTAG_CACHE_TIME)
|
||||
{
|
||||
$ctags = array();
|
||||
$last_request = time();
|
||||
}
|
||||
$signature = serialize(func_get_args());
|
||||
if (isset($ctags[$signature])) return $ctags[$signature];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user