Skip to content

Fix users.json caching, race condition, and atomic writes#118

Open
sabhishek13-py wants to merge 1 commit into
sutanjoyb:masterfrom
sabhishek13-py:fix/users-cache-race-condition
Open

Fix users.json caching, race condition, and atomic writes#118
sabhishek13-py wants to merge 1 commit into
sutanjoyb:masterfrom
sabhishek13-py:fix/users-cache-race-condition

Conversation

@sabhishek13-py

Copy link
Copy Markdown

Addressing issue : #114
This PR fixes issues related to repeated file reads, race conditions, and unsafe writes in user handling.

Changes:

Added in-memory caching for users.json to eliminate repeated disk I/O
Implemented thread-safe locking to prevent race conditions during concurrent access
Introduced atomic file write pattern using temporary file replacement
Ensured safe handling of shared in-memory state

Impact:

Prevents data loss during concurrent registrations
Improves performance by reducing unnecessary file reads
Ensures data consistency and integrity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants