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

Add Read only mode on jsonDB #44

Closed
gaelL opened this issue Dec 22, 2015 · 3 comments
Closed

Add Read only mode on jsonDB #44

gaelL opened this issue Dec 22, 2015 · 3 comments

Comments

@gaelL
Copy link
Collaborator

gaelL commented Dec 22, 2015

Simply add a readonly arg to jsonDB to not try to lock.

For example the ls url just need to read. No need to lock the db for that. https://github.com/guits/pastefile/blob/master/pastefile/app.py#L207

We also don't want to return a return "Lock timed out" in that case. Only read only database is enough.

@gaelL gaelL changed the title Add RO on jsonDB Add Read only mode on jsonDB Dec 22, 2015
@gaelL
Copy link
Collaborator Author

gaelL commented Dec 22, 2015

It will reduce the risk of having concurrent lock

@gaelL
Copy link
Collaborator Author

gaelL commented Dec 24, 2015

Checking the code, in fact if we don't want to lock and use the jsonDB as a read only,
just don't use the with statement.

db = jsonDB()
db.load()

Will return the db without lock. Just take care to not save but for feature like ls it's enough

@gaelL
Copy link
Collaborator Author

gaelL commented Dec 24, 2015

TODO rewrite part off controller.py to not lock the db.

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

No branches or pull requests

1 participant