@live-change/server 0.7.7 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,15 @@ const app = require("@live-change/framework").app()
8
8
  async function setupApiServer(settings) {
9
9
  const { services: config, withServices, updateServices } = settings
10
10
 
11
+ if(settings.createDb) {
12
+ const list = await app.dao.get(['database', 'databasesList'])
13
+ console.log("existing databases:", list.join(', '))
14
+ console.log("creating database", app.databaseName)
15
+ await app.dao.request(['database', 'createDatabase'], app.databaseName, {
16
+ storage: { noMetaSync: true, noSync: true }
17
+ }).catch(err => 'exists')
18
+ }
19
+
11
20
  const services = new Services(config)
12
21
 
13
22
  await services.loadServices()
@@ -6,7 +6,7 @@ function setupDbClient(argv, env = process.env) {
6
6
  const config = {
7
7
  url: env.DB_URL,
8
8
  name: env.DB_NAME,
9
- requestTimeout: (+env.DB_REQUEST_TIMEOUT),
9
+ requestTimeout: env.DB_REQUEST_TIMEOUT && +env.DB_REQUEST_TIMEOUT,
10
10
  cache: env.DB_CACHE == "YES",
11
11
  //unobserveDebug: env.UNOBSERVE_DEBUG == "YES",
12
12
  }
@@ -18,7 +18,7 @@ function setupDbClient(argv, env = process.env) {
18
18
  connectionSettings: {
19
19
  queueRequestsWhenDisconnected: true,
20
20
  requestSendTimeout: 2000,
21
- requestTimeout: this.requestTimeout,
21
+ requestTimeout: config.requestTimeout,
22
22
  queueActiveRequestsOnDisconnect: false,
23
23
  autoReconnectDelay: 200,
24
24
  logLevel: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/server",
3
- "version": "0.7.7",
3
+ "version": "0.7.9",
4
4
  "description": "Live Change Framework - server",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,10 +23,10 @@
23
23
  "dependencies": {
24
24
  "@live-change/dao": "0.5.8",
25
25
  "@live-change/dao-sockjs": "0.5.8",
26
- "@live-change/db-server": "0.5.21",
27
- "@live-change/framework": "^0.7.7",
26
+ "@live-change/db-server": "0.5.22",
27
+ "@live-change/framework": "^0.7.9",
28
28
  "@live-change/sockjs": "0.4.1",
29
- "@live-change/uid": "^0.7.7",
29
+ "@live-change/uid": "0.7.8",
30
30
  "dotenv": "^16.0.1",
31
31
  "express": "^4.18.1",
32
32
  "express-static-gzip": "2.1.7",
@@ -39,5 +39,5 @@
39
39
  "websocket": "^1.0.34",
40
40
  "yargs": "^17.5.1"
41
41
  },
42
- "gitHead": "281f8ce3d1baa6baaa90028e7ea86ac1f1680463"
42
+ "gitHead": "462acba65c69b87f6f2bf2d3c001e261edf2f7bb"
43
43
  }