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

Allow the repo locker to be passed by configuration #161

Closed
jacobheun opened this issue Apr 6, 2018 · 1 comment · Fixed by #162
Closed

Allow the repo locker to be passed by configuration #161

jacobheun opened this issue Apr 6, 2018 · 1 comment · Fixed by #162
Assignees

Comments

@jacobheun
Copy link
Contributor

Currently the only available lockers are fs and memory. It's currently not possible to set a locker via configuration. Providing support for this would allow new datastores to provide their own locking mechanism.

Perhaps updating the Repo initialization to include a locker property would be a good approach:

const repo = new Repo({
  locker: require('./my-locker')
})

Then when setting this._locker internally, it could check for either this.options.locker, or the fs|memory keys in this.options.lock

connects to ipfs/js-datastore-s3#1

@daviddias
Copy link
Member

Thanks for bringing this up. I agree there is a good case to make the lock file optional and even avoiding using fs-ext to lock on fs (which causes problems to electron). From my side:

  • 👍 on making the lock optional and configurable.
  • 👍 on abandoning fs-ext.

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 a pull request may close this issue.

2 participants