digidem / osm-p2p-db

Peer-to-peer database for OpenStreetMap data
BSD 2-Clause "Simplified" License
237 stars 25 forks source link

Close gracefully #28

Closed gmaclennan closed 7 years ago

gmaclennan commented 8 years ago

We need a method to close all the open stores gracefully, both level and chunk stores. There are many of them.

I'm unclear right now whether when electron quits it waits for any pending leveldb writes, we should make sure and close osm-p2p-db in the quit handler.

We need this function for cleanup of test dbs when running in the browser.

gmaclennan commented 7 years ago

See https://github.com/digidem/osm-p2p/issues/2 and https://github.com/digidem/osm-p2p-db/issues/51

hackergrrl commented 7 years ago

FWIW, I still think that a close() convenience method on osm-p2p-*db* would be useful and reasonable to add.