@routr/pgdata 2.17.0 → 2.18.0

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.
Files changed (2) hide show
  1. package/dist/service.js +10 -12
  2. package/package.json +3 -3
package/dist/service.js CHANGED
@@ -109,6 +109,13 @@ function pgDataService(config) {
109
109
  internalServer.bindAsync(config.bindAddr, credentials, () => {
110
110
  logger.info("internal server started", { bindAddr: config.bindAddr });
111
111
  });
112
+ // Report SERVING once the external server is up, with or without TLS
113
+ const onExternalServerStarted = () => {
114
+ healthImpl.setStatus("", common_1.GRPC_SERVING_STATUS);
115
+ logger.info("external server started", {
116
+ externalServerBindAddr: config.externalServerBindAddr
117
+ });
118
+ };
112
119
  if (envs_1.TLS_ON) {
113
120
  const cacert = envs_1.VERIFY_CLIENT_CERT ? fs_1.default.readFileSync(envs_1.CACERT) : null;
114
121
  const cert = fs_1.default.readFileSync(envs_1.SERVER_CERT);
@@ -121,19 +128,10 @@ function pgDataService(config) {
121
128
  private_key: key
122
129
  }
123
130
  ], envs_1.VERIFY_CLIENT_CERT);
124
- externalServer.bindAsync(config.externalServerBindAddr, externalCredentials, () => {
125
- logger.info("external server started", {
126
- externalServerBindAddr: config.externalServerBindAddr
127
- });
128
- });
131
+ externalServer.bindAsync(config.externalServerBindAddr, externalCredentials, onExternalServerStarted);
129
132
  }
130
133
  else {
131
- externalServer.bindAsync(config.externalServerBindAddr, credentials, () => {
132
- healthImpl.setStatus("", common_1.GRPC_SERVING_STATUS);
133
- logger.info("secure connection disabled");
134
- logger.info("external server started", {
135
- externalServerBindAddr: config.externalServerBindAddr
136
- });
137
- });
134
+ logger.info("secure connection disabled");
135
+ externalServer.bindAsync(config.externalServerBindAddr, credentials, onExternalServerStarted);
138
136
  }
139
137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/pgdata",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "Postgres API Server for Routr Connect",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -25,7 +25,7 @@
25
25
  "@grpc/grpc-js": "~1.14.6",
26
26
  "@prisma/client": "^6.19.1",
27
27
  "@routr/common": "^2.17.0",
28
- "@routr/processor": "^2.17.0",
28
+ "@routr/processor": "^2.18.0",
29
29
  "google-protobuf": "^3.21.4",
30
30
  "grpc-health-check": "^2.1.0",
31
31
  "pb-util": "^1.0.3",
@@ -51,5 +51,5 @@
51
51
  "@types/validator": "^13.15.10",
52
52
  "prisma": "^6.19.1"
53
53
  },
54
- "gitHead": "9bc2d0a407a82e7b3724bb139ba62504c7b3d49e"
54
+ "gitHead": "53d48803760e0d8d6af1efa63db2414594d79454"
55
55
  }