Browse Source

Merge branch 'release/0.6.1'

Book Pauk 6 years ago
parent
commit
153b635bdb
2 changed files with 3 additions and 2 deletions
  1. 1 1
      package.json
  2. 2 1
      server/db/connManager.js

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "Liberama",
-  "version": "0.6.0",
+  "version": "0.6.1",
   "engines": {
     "node": ">=10.0.0"
   },

+ 2 - 1
server/db/connManager.js

@@ -22,7 +22,8 @@ class ConnManager {
             const dbFileName = this.config.dataDir + '/' + poolConfig.fileName;
 
             //бэкап
-            await fs.copy(dbFileName, `${dbFileName}.bak`);
+            if (await fs.pathExists(dbFileName))
+                await fs.copy(dbFileName, `${dbFileName}.bak`);
 
             const connPool = new SqliteConnectionPool();
             await connPool.open(poolConfig.connCount, dbFileName);