Comments (6)
Hi @danielfdsilva,
If you're using osm-p2p-db (as opposed to osm-p2p - a simple wrapper) then you have control of the db instances you pass to the constructor, namely the hyperlog, the leveldb for join indexes, and the abstract-chunk-store (used for the kdb spatial index).
Each of these stores has a close()
method usually, that takes a callback. You basically need to close each one yourself. It would result in problems trying to do this in osm-p2p-db because you control the data stores that are passed to osm-p2p-db and they could vary with their methods for closing.
This should be documented better somewhere, and I don't know if their is a better solution.
from osm-p2p-db.
This makes me realize that osm-p2p really ought to have a close()
method.
from osm-p2p-db.
@gmaclennan
I'm actually using osm-p2p
, since it prepares all the databases needed to work with osm-p2p-server
.
I tried to access the different databases from the instance returned by osm-p2p
, but I still get the LOCK
error. I'm pretty sure I'm missing some.
I've tried:
db.db.close()
db.log.db.close()
db.kdb.db.close()
Any pointers at which I should be targeting?
from osm-p2p-db.
Run .close()
on:
db.db
db.log.db
db.kdb.kdb.store
(Fun caveat: db.kdb.kdb
doesn't exist at creation time; you need to wait a few ticks for it to silently set itself up async in the background.)
Looking at how much source code digging was necessary in order for me to figure that out, it seems a bit unreasonable that osm-p2p
and osm-p2p-db
don't expose close()
methods.
from osm-p2p-db.
@noffle That seems to have done it! thanks :)
from osm-p2p-db.
Fixed in 4.2.0 🎉
from osm-p2p-db.
Related Issues (20)
- Add ready() method HOT 1
- Close gracefully HOT 2
- edge cases with forks HOT 10
- ready() method does not wait for changeset index to catch up HOT 1
- Add osm.ready() to docs
- Spatial and date indexes on Changesets HOT 9
- Joining ways to nodes fails for numeric ids
- Changeset is not stored on deleted elements
- deleting relations does not correctly update the join index
- How to index deleted points? HOT 1
- How to handle deletions of documents referenced by others in a distributed system? HOT 3
- Store version as well as id on way.nodes and relation.members
- Quantization of lon/lat coordinates HOT 1
- deforking abstraction HOT 2
- Investigate indexing performance HOT 8
- Read up on bkd trees
- Way not returned when visible nodes are a subset of another way
- deterministic keys for osm data when importing HOT 2
- published version of osm-p2p-db contains benchmark outputs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osm-p2p-db.