Browse Source

Revert "lockfile in new subfolder"

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

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

@@ -230,7 +230,7 @@ email.reply.use_html_parsing = true
230 230
 email.reply.use_txt_parsing = true
231 231
 # Lockfile path is required for email_reply feature,
232 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 235
 ## Radical (CalDav server) configuration
236 236
 # radicale.server.host = 0.0.0.0

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

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

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

@@ -1,6 +1,5 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 
3
-import os
4 3
 import time
5 4
 import imaplib
6 5
 import json
@@ -189,14 +188,8 @@ class MailFetcher(object):
189 188
         self.token = token
190 189
         self.use_html_parsing = use_html_parsing
191 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 191
         self.lock = filelock.FileLock(lockfile_path)
192
+        self._is_active = True
200 193
 
201 194
     def run(self) -> None:
202 195
         logger.info(self, 'Starting MailFetcher')