fix(db): fix database setup

This commit is contained in:
Evan Morikawa 2015-06-26 11:17:23 -07:00
parent 926c623fba
commit 1d1c4a6e3a
2 changed files with 5 additions and 3 deletions

View file

@ -134,7 +134,7 @@
background: @background-primary;
border: 0;
box-shadow: 0 0px 0.5px rgba(0, 0, 0, 0.28), 0 1px 1.5px rgba(0, 0, 0, 0.08);
box-shadow: 0 0 0.5px rgba(0, 0, 0, 0.28), 0 1px 1.5px rgba(0, 0, 0, 0.08);
border-radius: 4px;
&:first-child { padding-top: 0; }
@ -356,7 +356,7 @@
z-index: 2;
border: 0;
box-shadow: 0 0px 0.5px rgba(0, 0, 0, 0.28), 0 1px 1.5px rgba(0, 0, 0, 0.08);
box-shadow: 0 0 0.5px rgba(0, 0, 0, 0.28), 0 1px 1.5px rgba(0, 0, 0, 0.08);
border-top: 1px dashed @border-color-divider;
border-radius: 0 0 4px 4px;
background: @background-primary;

View file

@ -61,6 +61,7 @@ class DatabaseManager
closeDatabaseConnection: (databasePath) ->
@_databases[databasePath]?.close()
delete @_databases[databasePath]
delete @_prepPromises[databasePath]
closeDatabaseConnections: ->
for path, val of @_databases
@ -72,6 +73,7 @@ class DatabaseManager
db.on 'close', -> fs.unlinkSync(path)
db.close()
delete @_databases[path]
delete @_prepPromises[path]
onIPCDatabaseQuery: (event, {databasePath, queryKey, query, values}) =>
db = @_databases[databasePath]
@ -121,7 +123,7 @@ class DatabaseManager
return Promise.resolve(db)
.catch (err) ->
@emit("setup-error", err)
console.error "There was an error setting up the database #{err?.message}"
console.error "!!!!!!!!!!! There was an error setting up the database #{err?.message}"
return Promise.reject(err)
_getDBAdapter: ->