From 6cefc224fbeef5c11595fdee2ea58ed6342d2b70 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 3 Jun 2023 08:37:09 +0200 Subject: [PATCH] Continued: - renamed lock_process() to acquire_lock() --- fba/boot.py | 2 +- fetch_bkali.py | 2 +- fetch_blocks.py | 2 +- fetch_fba_rss.py | 2 +- fetch_instances.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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] -- 2.39.5