Browse Source

Revert "lockfile in new subfolder"

Guénaël Muller 7 years ago
parent
commit
4ffa5f5779

+ 1 - 1
tracim/development.ini.base View File

230
 email.reply.use_txt_parsing = true
230
 email.reply.use_txt_parsing = true
231
 # Lockfile path is required for email_reply feature,
231
 # Lockfile path is required for email_reply feature,
232
 # it's just an empty file use to prevent concurrent access to imap unseen mail
232
 # it's just an empty file use to prevent concurrent access to imap unseen mail
233
-email.reply.lockfile_path = %(here)s/tmp/email_fetcher.lock
233
+email.reply.lockfile_path = %(here)s/email_fetcher.lock
234
 
234
 
235
 ## Radical (CalDav server) configuration
235
 ## Radical (CalDav server) configuration
236
 # radicale.server.host = 0.0.0.0
236
 # radicale.server.host = 0.0.0.0

+ 1 - 1
tracim/tracim/config/app_cfg.py View File

394
         ))
394
         ))
395
         self.EMAIL_REPLY_LOCKFILE_PATH = tg.config.get(
395
         self.EMAIL_REPLY_LOCKFILE_PATH = tg.config.get(
396
             'email.reply.lockfile_path',
396
             'email.reply.lockfile_path',
397
-            '/tmp/tracim/email_fetcher.lock'
397
+            '/tmp/tracim_email_fetcher.lock'
398
         )
398
         )
399
 
399
 
400
         self.TRACKER_JS_PATH = tg.config.get(
400
         self.TRACKER_JS_PATH = tg.config.get(

+ 1 - 8
tracim/tracim/lib/email_fetcher.py View File

1
 # -*- coding: utf-8 -*-
1
 # -*- coding: utf-8 -*-
2
 
2
 
3
-import os
4
 import time
3
 import time
5
 import imaplib
4
 import imaplib
6
 import json
5
 import json
189
         self.token = token
188
         self.token = token
190
         self.use_html_parsing = use_html_parsing
189
         self.use_html_parsing = use_html_parsing
191
         self.use_txt_parsing = use_txt_parsing
190
         self.use_txt_parsing = use_txt_parsing
192
-        self._set_lock(lockfile_path)
193
-        self._is_active = True
194
-
195
-    def _set_lock(self, lockfile_path):
196
-        dir_path = os.path.dirname(lockfile_path)
197
-        if dir_path:
198
-            os.makedirs(dir_path, exist_ok=True)
199
         self.lock = filelock.FileLock(lockfile_path)
191
         self.lock = filelock.FileLock(lockfile_path)
192
+        self._is_active = True
200
 
193
 
201
     def run(self) -> None:
194
     def run(self) -> None:
202
         logger.info(self, 'Starting MailFetcher')
195
         logger.info(self, 'Starting MailFetcher')