From: Roland Häder Date: Sat, 3 Jun 2023 06:37:09 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6cefc224fbeef5c11595fdee2ea58ed6342d2b70;p=fba.git Continued: - renamed lock_process() to acquire_lock() --- diff --git a/fba/boot.py b/fba/boot.py index 8f962fc..605d2ea 100644 --- a/fba/boot.py +++ b/fba/boot.py @@ -24,7 +24,7 @@ from fba import fba lockfile = tempfile.gettempdir() + '/fba.lock' LOCK = None -def lock_process(): +def acquire_lock(): global LOCK try: print(f"DEBUG: Acquiring lock: '{lockfile}'") diff --git a/fetch_bkali.py b/fetch_bkali.py index f6b6fdb..0dbefc0 100755 --- a/fetch_bkali.py +++ b/fetch_bkali.py @@ -22,7 +22,7 @@ import sys import validators from fba import * -boot.lock_process() +boot.acquire_lock() domains = list() try: diff --git a/fetch_blocks.py b/fetch_blocks.py index c7f25f5..900f1c0 100755 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -25,7 +25,7 @@ import re import validators from fba import * -boot.lock_process() +boot.acquire_lock() fba.cursor.execute( "SELECT domain, software, origin, nodeinfo_url FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'gotosocial', 'bookwyrm', 'takahe') AND (last_blocked IS NULL OR last_blocked < ?) ORDER BY rowid DESC", [time.time() - fba.config["recheck_block"]] diff --git a/fetch_fba_rss.py b/fetch_fba_rss.py index 022f46e..4db5434 100755 --- a/fetch_fba_rss.py +++ b/fetch_fba_rss.py @@ -22,7 +22,7 @@ import rss_parser import sys from fba import * -boot.lock_process() +boot.acquire_lock() feed = sys.argv[1] diff --git a/fetch_instances.py b/fetch_instances.py index 926ccf6..08b49e8 100755 --- a/fetch_instances.py +++ b/fetch_instances.py @@ -24,7 +24,7 @@ import time import validators from fba import * -boot.lock_process() +boot.acquire_lock() instance = sys.argv[1]