Skip to content

Commit 0cfd291

Browse files
authored
Merge pull request #68 from tristanlatr/66-fix-filelock-runtimeerror
Fixes #66
2 parents ae5fdd7 + 55da24b commit 0cfd291

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

wpwatcher/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Project version and meta informations.
66
"""
77

8-
__version__ = "3.0.5"
8+
__version__ = "3.0.6"
99
__title__ = "wpwatcher"
1010
__description__ = "WPWatcher - Automating WPScan to scan and report vulnerable Wordpress sites"
1111
__author__ = "Florian Roth, Tristan Landes"

wpwatcher/db.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ def __init__(self, filepath: Optional[str] = None, daemon: bool = False):
4141
# Writing into the database file is thread safe
4242
self._wp_report_lock: threading.Lock = threading.Lock()
4343

44-
# Only once instance of WPWatcher can use a database file at a time.
45-
self._wp_report_file_lock: FileLock = FileLock(f"{self.filepath}.lock")
44+
try:
45+
lock = FileLock(f"{self.filepath}.lock", thread_local=False)
46+
except:
47+
lock = FileLock(f"{self.filepath}.lock")
4648

49+
# Only one instance of WPWatcher can use a database file at a time.
50+
self._wp_report_file_lock: FileLock = lock
4751

4852
def open(self) -> None:
4953
"""

0 commit comments

Comments
 (0)