Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement file locking in CacheRepository to resolve concurrency issues #251

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anmolgupta2015
Copy link

Summary

This PR enhances the CacheRepository to address concurrency issues during cache file operations.

Changes Made

  1. Added file locking using the fs2 crate to ensure exclusive access during writes.
  2. Modified the write_cache method to lock the file during the writing process and unlock it after completion.
  3. Improved reliability and data integrity by preventing simultaneous writes to cache files.

Purpose

To resolve concurrency issues and ensure thread-safe access to cache files.

Issue Reference

Fixes #234

@anmolgupta2015
Copy link
Author

Hii @Pranav0-0Aggarwal Sir,
kindly check and merge code .. if you find no issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Implement File Locking for Concurrent Writes
1 participant