Browse Source

naming filelock->lockfile + default lockfile_path

Guénaël Muller 7 years ago
parent
commit
ddb4624d99

+ 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.filelock_path = %(here)s/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

+ 3 - 2
tracim/tracim/config/app_cfg.py View File

392
             'email.reply.use_txt_parsing',
392
             'email.reply.use_txt_parsing',
393
             True,
393
             True,
394
         ))
394
         ))
395
-        self.EMAIL_REPLY_FILELOCK_PATH = tg.config.get(
396
-            'email.reply.filelock_path',
395
+        self.EMAIL_REPLY_LOCKFILE_PATH = tg.config.get(
396
+            'email.reply.lockfile_path',
397
+            '/tmp/tracim_email_fetcher.lock'
397
         )
398
         )
398
 
399
 
399
         self.TRACKER_JS_PATH = tg.config.get(
400
         self.TRACKER_JS_PATH = tg.config.get(

+ 1 - 1
tracim/tracim/lib/daemons.py View File

179
             token=cfg.EMAIL_REPLY_TOKEN,
179
             token=cfg.EMAIL_REPLY_TOKEN,
180
             use_html_parsing=cfg.EMAIL_REPLY_USE_HTML_PARSING,
180
             use_html_parsing=cfg.EMAIL_REPLY_USE_HTML_PARSING,
181
             use_txt_parsing=cfg.EMAIL_REPLY_USE_TXT_PARSING,
181
             use_txt_parsing=cfg.EMAIL_REPLY_USE_TXT_PARSING,
182
-            filelock_path=cfg.EMAIL_REPLY_FILELOCK_PATH,
182
+            lockfile_path=cfg.EMAIL_REPLY_LOCKFILE_PATH,
183
         )
183
         )
184
         self._fetcher.run()
184
         self._fetcher.run()
185
 
185
 

+ 2 - 2
tracim/tracim/lib/email_fetcher.py View File

158
         token: str,
158
         token: str,
159
         use_html_parsing: bool,
159
         use_html_parsing: bool,
160
         use_txt_parsing: bool,
160
         use_txt_parsing: bool,
161
-        filelock_path: str,
161
+        lockfile_path: str,
162
     ) -> None:
162
     ) -> None:
163
         """
163
         """
164
         Fetch mail from a mailbox folder through IMAP and add their content to
164
         Fetch mail from a mailbox folder through IMAP and add their content to
188
         self.token = token
188
         self.token = token
189
         self.use_html_parsing = use_html_parsing
189
         self.use_html_parsing = use_html_parsing
190
         self.use_txt_parsing = use_txt_parsing
190
         self.use_txt_parsing = use_txt_parsing
191
-        self.lock = filelock.FileLock(filelock_path)
191
+        self.lock = filelock.FileLock(lockfile_path)
192
         self._is_active = True
192
         self._is_active = True
193
 
193
 
194
     def run(self) -> None:
194
     def run(self) -> None: