import email unlock tables

This commit is contained in:
yuri
2018-02-19 15:00:49 +02:00
parent 05eeb82efd
commit ccdee9ec09
2 changed files with 2 additions and 6 deletions
+1 -3
View File
@@ -368,9 +368,7 @@ class EmailAccount extends Record
$email = $importer->importMessage($parserName, $message, $userId, $teamIdList, $userIdList, $filterCollection, $fetchOnlyHeader, $folderData);
} catch (\Exception $e) {
$GLOBALS['log']->error('EmailAccount '.$emailAccount->id.' (Import Message w/ '.$parserName.'): [' . $e->getCode() . '] ' .$e->getMessage());
if ($e->getCode() === 'HY000' && strpos($e->getMessage(), '1100') !== false) {
$this->getEntityManager()->getPdo()->query('UNLOCK TABLES');
}
$this->getEntityManager()->getPdo()->query('UNLOCK TABLES');
}
return $email;
}
+1 -3
View File
@@ -394,9 +394,7 @@ class InboundEmail extends \Espo\Services\Record
$email = $importer->importMessage($parserName, $message, $userId, $teamIdList, $userIdList, $filterCollection, $fetchOnlyHeader, $folderData);
} catch (\Exception $e) {
$GLOBALS['log']->error('InboundEmail '.$emailAccount->id.' (Import Message w/ '.$parserName.'): [' . $e->getCode() . '] ' .$e->getMessage());
if ($e->getCode() === 'HY000' && strpos($e->getMessage(), '1100') !== false) {
$this->getEntityManager()->getPdo()->query('UNLOCK TABLES');
}
$this->getEntityManager()->getPdo()->query('UNLOCK TABLES');
}
return $email;
}