@@ -42,7 +42,6 @@ let appMenu = null;
4242let minimumMenu = null ;
4343electron . app . on ( 'window-all-closed' , async ( ) => {
4444 await require ( './Util/GA' ) . default . eventAppEnd ( 'app' , 'end' ) ;
45- await require ( './DB/DB' ) . default . exec ( 'vacuum' ) ;
4645 electron . app . quit ( ) ;
4746} ) ;
4847
@@ -277,6 +276,7 @@ electron.app.whenReady().then(function() {
277276 submenu : [
278277 { label : 'DevTools(Main)' , click : ( ) => { mainWindow . webContents . openDevTools ( { mode : 'detach' } ) ; } } ,
279278 { label : 'DevTools(BrowserView)' , click : ( ) => { BrowserViewProxy . openDevTools ( { mode : 'detach' } ) ; } } ,
279+ { label : 'SQLite Vacuum' , click : vacuum } ,
280280 ]
281281 }
282282 ] ;
@@ -347,7 +347,6 @@ electron.app.whenReady().then(function() {
347347
348348async function quit ( ) {
349349 await require ( './Util/GA' ) . default . eventAppEnd ( 'app' , 'end' ) ;
350- await require ( './DB/DB' ) . default . exec ( 'vacuum' ) ;
351350 electron . app . exit ( 0 ) ;
352351}
353352
@@ -728,6 +727,18 @@ function zoom(diffFactor, abs) {
728727 require ( './Util/GA' ) . default . eventMenu ( `zoom:${ currentZoom } ` ) ;
729728}
730729
730+ async function vacuum ( ) {
731+ const notification = new electron . Notification ( { title : 'SQLite Vacuum' , body : 'Running...' } ) ;
732+ notification . show ( ) ;
733+
734+ const Bootstrap = require ( './Bootstrap.js' ) . default ;
735+ await Bootstrap . stop ( ) ;
736+ await require ( './DB/DB' ) . default . exec ( 'vacuum' ) ;
737+ await Bootstrap . restart ( ) ;
738+
739+ notification . close ( ) ;
740+ }
741+
731742// target is webview|issues|streams
732743function commandWebContents ( target , command ) {
733744 // hack
0 commit comments