Close database after migration
This is not 100% reliable as database connections are closed in a separate
thread according to the documentation:
- https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/close
- https://stackoverflow.com/a/18639298
- 80c7a06d5c/backbone-indexeddb.js (L558-L565)
This commit is contained in:
parent
c765422fa1
commit
fcd30cd919
4 changed files with 18 additions and 11 deletions
|
@ -85,11 +85,14 @@
|
|||
console.log('Start IndexedDB migrations');
|
||||
|
||||
console.log('Migrate database with attachments');
|
||||
await Migrations0DatabaseWithAttachmentData.run({ Backbone });
|
||||
const closeDatabase = () =>
|
||||
Whisper.Database.close();
|
||||
await Migrations0DatabaseWithAttachmentData.run({ Backbone, closeDatabase });
|
||||
|
||||
console.log('Migrate database without attachments');
|
||||
await Migrations1DatabaseWithoutAttachmentData.run({
|
||||
Backbone,
|
||||
closeDatabase,
|
||||
Database: Whisper.Database,
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue