mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Try to cache vacation for each account to avoid to connect to IMAP server if vacation rules are not changed
This commit is contained in:
parent
70d85ca78f
commit
4830bcf784
@ -620,6 +620,8 @@ class mail_sieve
|
|||||||
{
|
{
|
||||||
self::setAsyncJob($newVacation);
|
self::setAsyncJob($newVacation);
|
||||||
}
|
}
|
||||||
|
//Reset vacationNotice cache which is used in mail_ui get_rows
|
||||||
|
egw_cache::unsetCache(egw_cache::INSTANCE,'email', 'vacationNotice'+$icServer->acc_id);
|
||||||
$msg = lang('Vacation notice sucessfully updated.');
|
$msg = lang('Vacation notice sucessfully updated.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2295,9 +2295,21 @@ class mail_ui
|
|||||||
{
|
{
|
||||||
$sieveServer = $this->mail_bo->icServer;
|
$sieveServer = $this->mail_bo->icServer;
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
//Get vacation from cache if it's available
|
||||||
|
$vacationCached = egw_cache::getCache(egw_cache::INSTANCE, 'email', 'vacationNotice'+$sieveServer->acc_id);
|
||||||
|
|
||||||
|
if (!$vacationCached)
|
||||||
{
|
{
|
||||||
$sieveServer->retrieveRules();
|
$sieveServer->retrieveRules();
|
||||||
$vacation = $sieveServer->getVacation();
|
$vacation = $sieveServer->getVacation();
|
||||||
|
// Set vacation to the instance cache for particular account
|
||||||
|
egw_cache::setCache(egw_cache::INSTANCE, 'email', 'vacationNotice'+$sieveServer->acc_id, $vacation);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $vacationCached;
|
||||||
|
}
|
||||||
} catch (PEAR_Exception $ex) {
|
} catch (PEAR_Exception $ex) {
|
||||||
$this->callWizard($ex->getMessage());
|
$this->callWizard($ex->getMessage());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user