From ccdee9ec0956ca8135bc5b0fe6cb164cf75d72d3 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 19 Feb 2018 15:00:49 +0200 Subject: [PATCH] import email unlock tables --- application/Espo/Services/EmailAccount.php | 4 +--- application/Espo/Services/InboundEmail.php | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/application/Espo/Services/EmailAccount.php b/application/Espo/Services/EmailAccount.php index a1e53dbe8b..4abc39db7a 100644 --- a/application/Espo/Services/EmailAccount.php +++ b/application/Espo/Services/EmailAccount.php @@ -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; } diff --git a/application/Espo/Services/InboundEmail.php b/application/Espo/Services/InboundEmail.php index 3f541d2d48..75177a4639 100644 --- a/application/Espo/Services/InboundEmail.php +++ b/application/Espo/Services/InboundEmail.php @@ -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; }