@naturalcycles/backend-lib 9.11.0 → 9.13.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.
@@ -2,22 +2,20 @@ import { _filterNullishValues, localTime } from '@naturalcycles/js-lib';
2
2
  import { memoryUsageFull, processSharedUtil } from '@naturalcycles/nodejs-lib';
3
3
  import { getDeployInfo } from './deployInfo.util.js';
4
4
  const { versions, arch, platform } = process;
5
- const { GAE_APPLICATION, GAE_SERVICE, GAE_VERSION, GOOGLE_CLOUD_PROJECT, K_SERVICE, K_REVISION, APP_ENV, NODE_OPTIONS, } = process.env;
5
+ const { GAE_APPLICATION, GAE_SERVICE, GAE_VERSION, GOOGLE_CLOUD_PROJECT, K_SERVICE, K_REVISION, APP_ENV, NODE_OPTIONS, DEPLOY_BUILD_TIME, } = process.env;
6
6
  export function serverStatusMiddleware(projectDir, extra) {
7
7
  return async (_req, res) => {
8
8
  res.json(getServerStatusData(projectDir, extra));
9
9
  };
10
10
  }
11
11
  export function getServerStatusData(projectDir = process.cwd(), extra) {
12
- const { gitRev, gitBranch, ts } = getDeployInfo(projectDir);
12
+ const { ts } = getDeployInfo(projectDir);
13
13
  const t = localTime(ts);
14
- const deployBuildTime = t.toPretty();
15
- const buildInfo = [t.toStringCompact(), gitBranch, gitRev].filter(Boolean).join('_');
14
+ const deployBuildTime = DEPLOY_BUILD_TIME || t.toPretty();
16
15
  return _filterNullishValues({
17
- started: getStartedStr(),
16
+ nodeProcessStarted: getStartedStr(),
18
17
  deployBuildTime,
19
18
  APP_ENV,
20
- buildInfo,
21
19
  GOOGLE_CLOUD_PROJECT,
22
20
  GAE_APPLICATION,
23
21
  GAE_SERVICE,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/backend-lib",
3
3
  "type": "module",
4
- "version": "9.11.0",
4
+ "version": "9.13.0",
5
5
  "peerDependencies": {
6
6
  "@sentry/node": "^9"
7
7
  },
@@ -13,6 +13,7 @@ const {
13
13
  K_REVISION,
14
14
  APP_ENV,
15
15
  NODE_OPTIONS,
16
+ DEPLOY_BUILD_TIME,
16
17
  } = process.env
17
18
 
18
19
  export function serverStatusMiddleware(projectDir?: string, extra?: any): BackendRequestHandler {
@@ -25,16 +26,14 @@ export function getServerStatusData(
25
26
  projectDir: string = process.cwd(),
26
27
  extra?: any,
27
28
  ): Record<string, any> {
28
- const { gitRev, gitBranch, ts } = getDeployInfo(projectDir)
29
+ const { ts } = getDeployInfo(projectDir)
29
30
  const t = localTime(ts)
30
- const deployBuildTime = t.toPretty()
31
- const buildInfo = [t.toStringCompact(), gitBranch, gitRev].filter(Boolean).join('_')
31
+ const deployBuildTime = DEPLOY_BUILD_TIME || t.toPretty()
32
32
 
33
33
  return _filterNullishValues({
34
- started: getStartedStr(),
34
+ nodeProcessStarted: getStartedStr(),
35
35
  deployBuildTime,
36
36
  APP_ENV,
37
- buildInfo,
38
37
  GOOGLE_CLOUD_PROJECT,
39
38
  GAE_APPLICATION,
40
39
  GAE_SERVICE,