File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,4 +60,5 @@ custom_profiles/
6060# Security tools
6161/tools /security /*
6262Apps /Windows /inspector.exe
63- Framework /settings.conf.lock
63+ Apps /Windows /Element.xml
64+ Framework /settings.conf.lock
Original file line number Diff line number Diff line change 66from pathlib import Path
77from datetime import date
88from configobj import ConfigObj
9+ import traceback
910
1011"""constants"""
1112file_name = "settings.conf"
@@ -48,6 +49,16 @@ def create_settings_config_file():
4849 config .write ()
4950 print (f"Created settings.conf at { settings_conf_path } " )
5051
52+ def remove_settings_lock_file ():
53+ """Remove stale lock file if the process that created it is no longer running."""
54+ try :
55+ lock_file_path = Path (settings_file_lock .lock_file )
56+ if not lock_file_path .exists ():
57+ return
58+ lock_file_path .unlink (missing_ok = True )
59+ except Exception :
60+ traceback .print_exc ()
61+
5162@settings_file_lock
5263def get_config_value (section , key , location : os .PathLike | None = None ):
5364 """
Original file line number Diff line number Diff line change @@ -1230,6 +1230,7 @@ async def main():
12301230 # Load environment variables from .env file
12311231 load_dotenv ()
12321232 adjust_python_path ()
1233+ ConfigModule .remove_settings_lock_file ()
12331234 ConfigModule .create_settings_config_file ()
12341235 create_temp_ini_automation_log ()
12351236
You can’t perform that action at this time.
0 commit comments