Skip to content

Commit 070fa3f

Browse files
authored
Merge pull request #232 from vicsanity623/pyob-evolution-v1-1773793013
Fix: Synchronize access to shared issue status file
2 parents 9919cd6 + a900cb4 commit 070fa3f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/pyob/dashboard_server.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ def api_analysis_data():
9999

100100
issue_statuses = {}
101101
status_file = "issue_statuses.json"
102-
if os.path.exists(status_file):
103-
with open(status_file, "r", encoding="utf-8") as f:
104-
issue_statuses = json.load(f)
102+
with status_lock: # Acquire lock before reading shared resource
103+
if os.path.exists(status_file):
104+
with open(status_file, "r", encoding="utf-8") as f:
105+
issue_statuses = json.load(f)
105106

106107
# Merge statuses into parsed_data.
107108
# This logic assumes parsed_data is a dictionary with an 'issues' key,

0 commit comments

Comments
 (0)