Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-02-28 13:40:38 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-20 11:36:49 +0300
commit7ef27f18b637aee4b7956b7de0471abf0ba01818 (patch)
treeb6d49363cd30ea60ef4a03855c235382ebfb5b77 /lib/BackgroundJob
parent681857260cdabb283d6a3aea6e2f6e5f93c17fd0 (diff)
Simplify the virtual favorite inbox
* Remove the heavy-weight virtual flagged mailbox * Implement a favorites inbox as a simple filtered view * Refactor the sync logic so it work with filtered mailboxes Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/BackgroundJob')
-rw-r--r--lib/BackgroundJob/SyncJob.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/BackgroundJob/SyncJob.php b/lib/BackgroundJob/SyncJob.php
index 6dfab3d2e..5fc7c05c0 100644
--- a/lib/BackgroundJob/SyncJob.php
+++ b/lib/BackgroundJob/SyncJob.php
@@ -23,8 +23,10 @@
namespace OCA\Mail\BackgroundJob;
+use Exception;
+use OCA\Mail\Exception\IncompleteSyncException;
use OCA\Mail\Service\AccountService;
-use OCA\Mail\Service\SyncService;
+use OCA\Mail\Service\Sync\ImapToDbSynchronizer;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
@@ -35,7 +37,7 @@ class SyncJob extends TimedJob {
/** @var AccountService */
private $accountService;
- /** @var SyncService */
+ /** @var ImapToDbSynchronizer */
private $syncService;
/** @var ILogger */
private $logger;
@@ -44,7 +46,7 @@ class SyncJob extends TimedJob {
public function __construct(ITimeFactory $time,
AccountService $accountService,
- SyncService $syncService,
+ ImapToDbSynchronizer $syncService,
ILogger $logger,
IJobList $jobList) {
parent::__construct($time);
@@ -70,7 +72,11 @@ class SyncJob extends TimedJob {
try {
$this->syncService->syncAccount($account);
- } catch (\Exception $e) {
+ } catch (IncompleteSyncException $e) {
+ $this->logger->logException($e, [
+ 'level' => ILogger::WARN,
+ ]);
+ } catch (Exception $e) {
$this->logger->logException($e);
}
}