Fix logic for creating pidfile parent dir (#512)

This commit is contained in:
Tessa Walsh 2023-01-23 20:02:25 -05:00 committed by GitHub
parent be4f918149
commit c0e2ec6155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ class UniqueWorker:
def set_id(self):
"""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)
with open(self.path, "w", encoding="utf-8") as pid_file: