Skip to content

Commit

Permalink
add blobStore.close()
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaclennan committed Oct 29, 2024
1 parent 81c9253 commit b847084
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/blob-store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ export class BlobStore extends TypedEmitter {

return drive.clear(path, options)
}

close() {
this.#downloader.removeAllListeners()
this.#downloader.destroy()
}
}

// Don't want to export the class, but do want to export the type.
Expand Down
1 change: 1 addition & 0 deletions src/mapeo-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ export class MapeoProject extends TypedEmitter {
*/
async close() {
this.#l.log('closing project %h', this.#projectId)
this.#blobStore.close()
const dataStorePromises = []
for (const dataStore of Object.values(this.#dataStores)) {
dataStorePromises.push(dataStore.close())
Expand Down

0 comments on commit b847084

Please sign in to comment.