File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class SyncJob extends TimedJob {
3232 private IUserManager $ userManager ;
3333 private IJobList $ jobList ;
3434 private readonly bool $ forcedSyncInterval ;
35+ private readonly bool $ forcedSkip ;
3536
3637 public function __construct (
3738 ITimeFactory $ time ,
@@ -51,7 +52,15 @@ public function __construct(
5152 $ configuredSyncInterval = $ config ->getSystemValueInt ('app.mail.background-sync-interval ' );
5253 if ($ configuredSyncInterval > 0 ) {
5354 $ this ->forcedSyncInterval = true ;
55+ $ this ->forcedSkip = false ;
5456 } else {
57+ if ($ configuredSyncInterval === -1 ) {
58+ $ this ->forcedSkip = true ;
59+ }
60+ else {
61+ $ this ->forcedSkip = false ;
62+ }
63+
5564 $ this ->forcedSyncInterval = false ;
5665 $ configuredSyncInterval = self ::DEFAULT_SYNC_INTERVAL ;
5766 }
@@ -65,6 +74,10 @@ public function __construct(
6574 */
6675 #[\Override]
6776 protected function run ($ argument ) {
77+ if ($ this ->forcedSkip ) {
78+ return ;
79+ }
80+
6881 $ accountId = (int )$ argument ['accountId ' ];
6982
7083 try {
You can’t perform that action at this time.
0 commit comments