File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -263,9 +263,13 @@ function removeJob(id: number) {
263263}
264264
265265function makeJob ( fnName : string ) {
266- if ( _shuttingDown && fnName !== 'close' ) {
266+ if ( _shuttingDown && fnName !== 'close' && fnName !== 'removeDB' ) {
267267 throw new Error ( `Rejecting SQL channel job (${ fnName } ); application is shutting down` ) ;
268268 }
269+ if ( ! _shuttingDown && fnName === 'close' ) {
270+ window ?. log ?. debug ( `SQL channel job close() called, marking as shutting down` ) ;
271+ _shuttingDown = true ;
272+ }
269273
270274 _jobCounter += 1 ;
271275 const id = _jobCounter ;
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export function closeDbInstance() {
3737 }
3838 const dbRef = globalInstance ;
3939 globalInstance = null ;
40- // SQLLite documentation suggests that we run `PRAGMA optimize` right before
40+ // SQlite documentation suggests that we run `PRAGMA optimize` right before
4141 // closing the database connection.
4242 dbRef . pragma ( 'optimize' ) ;
4343 dbRef . close ( ) ;
You can’t perform that action at this time.
0 commit comments