Fix logic for creating pidfile parent dir (#512)
This commit is contained in:
parent
be4f918149
commit
c0e2ec6155
@ -17,7 +17,7 @@ class UniqueWorker:
|
|||||||
|
|
||||||
def set_id(self):
|
def set_id(self):
|
||||||
"""Create path to pid file and write to pid."""
|
"""Create path to pid file and write to pid."""
|
||||||
if self.path.exists():
|
if not self.path.exists():
|
||||||
self.path.parents[0].mkdir(parents=True, exist_ok=True)
|
self.path.parents[0].mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
with open(self.path, "w", encoding="utf-8") as pid_file:
|
with open(self.path, "w", encoding="utf-8") as pid_file:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user