mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] avoid a possible thread problem
This commit is contained in:
parent
5fba284260
commit
5eda0fe20e
1 changed files with 3 additions and 3 deletions
|
@ -74,7 +74,9 @@ class Journal(object):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.category = category
|
self.category = category
|
||||||
self.first_write = True
|
self.first_write = True
|
||||||
self.started_at = None
|
|
||||||
|
# this help uniformise file name and avoir threads concurrency errors
|
||||||
|
self.started_at = datetime.now()
|
||||||
|
|
||||||
self.path = os.path.join(JOURNALS_PATH, category)
|
self.path = os.path.join(JOURNALS_PATH, category)
|
||||||
|
|
||||||
|
@ -101,8 +103,6 @@ class Journal(object):
|
||||||
self.fd.flush()
|
self.fd.flush()
|
||||||
|
|
||||||
def _do_first_write(self):
|
def _do_first_write(self):
|
||||||
self.started_at = datetime.now()
|
|
||||||
|
|
||||||
if not os.path.exists(self.path):
|
if not os.path.exists(self.path):
|
||||||
os.makedirs(self.path)
|
os.makedirs(self.path)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue