mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +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);
|
||||
}
|
||||
//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.');
|
||||
}
|
||||
}
|
||||
|
@ -2296,8 +2296,20 @@ class mail_ui
|
||||
$sieveServer = $this->mail_bo->icServer;
|
||||
try
|
||||
{
|
||||
$sieveServer->retrieveRules();
|
||||
$vacation = $sieveServer->getVacation();
|
||||
//Get vacation from cache if it's available
|
||||
$vacationCached = egw_cache::getCache(egw_cache::INSTANCE, 'email', 'vacationNotice'+$sieveServer->acc_id);
|
||||
|
||||
if (!$vacationCached)
|
||||
{
|
||||
$sieveServer->retrieveRules();
|
||||
$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) {
|
||||
$this->callWizard($ex->getMessage());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user