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

feat: add project.close() #375

Merged
merged 22 commits into from
Dec 7, 2023
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8adec47
initial implementation of project.close()
Nov 13, 2023
7529dc6
add `close` to Datastore, use `coreManager.close()`
Nov 13, 2023
356d4ee
add sqlite as a private field, `.close()` it on `MapeoProject.close()`
Nov 13, 2023
1df497d
close dataStores in parallel
Nov 15, 2023
e3c395c
await #coreManager.close and dataStore promises
Nov 16, 2023
0e7ce31
update multi-core-indexer to alpha8
Nov 16, 2023
1062410
update lock
Nov 16, 2023
3e33597
Merge branch 'main' of github.com:digidem/mapeo-core-next into feat/p…
Nov 16, 2023
ef7f93e
fix package-lock, add tests to close
Nov 21, 2023
bd88106
fix `.getMany` test for `project.close()`
Nov 21, 2023
904ee40
add tests for creating project after `project.close()`
Nov 21, 2023
f218f09
Merge branch 'main' of github.com:digidem/mapeo-core-next into feat/p…
Nov 21, 2023
6774279
Merge branch 'main' of github.com:digidem/mapeo-core-next into feat/p…
Dec 4, 2023
57ba9fc
* remove 'multiCoreIndexer.removeAllListener()' (the class is already
Dec 4, 2023
5fee846
remove cached project in manager after closing project
achou11 Dec 5, 2023
1ad7057
remove added listeners in mapeo project after close
achou11 Dec 5, 2023
a1b742e
[OPTIC-RELEASE-AUTOMATION] release/v9.0.0-alpha.3 (#404)
optic-release-automation[bot] Dec 5, 2023
c286486
Revert "[OPTIC-RELEASE-AUTOMATION] release/v9.0.0-alpha.3 (#404)"
achou11 Dec 5, 2023
d54311b
Merge branch 'main' into feat/projectClose
achou11 Dec 5, 2023
fd83222
update flaky sync e2e test now that project.close() is implemented
achou11 Dec 5, 2023
169af66
const instead of let in close() method
achou11 Dec 5, 2023
02ba36e
fix: close cores after indexing is closed
gmaclennan Dec 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/mapeo-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,11 @@ export class MapeoProject {
async close() {
this.#l.log('closing project %h', this.#projectId)
this.#coreManager.close()
tomasciccola marked this conversation as resolved.
Show resolved Hide resolved
tomasciccola marked this conversation as resolved.
Show resolved Hide resolved

// eslint-disable-next-line no-unused-vars
for await (let [_, dataStore] of Object.entries(this.#dataStores)) {
await dataStore.close()
let dataStorePromises = []
for (const dataStore of Object.values(this.#dataStores)) {
dataStorePromises.push(dataStore.close())
}
Promise.all(dataStorePromises)
tomasciccola marked this conversation as resolved.
Show resolved Hide resolved

this.#sqlite.close()
}
Expand Down