@thzero/library_server 0.17.21 → 0.17.22
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.
- package/boot/index.js +2 -1
- package/package.json +2 -2
- package/service/usageMetrics.js +2 -2
- package/service/utility.js +3 -3
package/boot/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import LibraryServerConstants from '../constants.js';
|
|
|
8
8
|
import LibraryCommonServiceConstants from '@thzero/library_common_service/constants.js';
|
|
9
9
|
|
|
10
10
|
import LibraryCommonUtility from '@thzero/library_common/utility/index.js';
|
|
11
|
+
import LibraryMomentUtility from '@thzero/library_common/utility/moment.js';
|
|
11
12
|
|
|
12
13
|
import NotImplementedError from '@thzero/library_common/errors/notImplemented.js';
|
|
13
14
|
|
|
@@ -300,7 +301,7 @@ class BootMain {
|
|
|
300
301
|
this._servicesPost.set(key, value);
|
|
301
302
|
}
|
|
302
303
|
|
|
303
|
-
|
|
304
|
+
LibraryMomentUtility.initDateTime();
|
|
304
305
|
}
|
|
305
306
|
finally {
|
|
306
307
|
this._repositories = null;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thzero/library_server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.22",
|
|
5
5
|
"version_major": 0,
|
|
6
6
|
"version_minor": 17,
|
|
7
|
-
"version_patch":
|
|
7
|
+
"version_patch": 22,
|
|
8
8
|
"version_date": "01/20/2024",
|
|
9
9
|
"description": "An opinionated library of common functionality to bootstrap an API using either Fastify or Koa as the web server.",
|
|
10
10
|
"author": "thZero",
|
package/service/usageMetrics.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import LibraryServerConstants from '../constants.js';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import LibraryMomentUtility from '@thzero/library_common/utility/moment.js';
|
|
4
4
|
|
|
5
5
|
import Service from './index.js';
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ class UsageMetricsService extends Service {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
usageMetrics.date = new Date(new Date(
|
|
35
|
+
usageMetrics.date = new Date(new Date(LibraryMomentUtility.getTimestamp()).toISOString());
|
|
36
36
|
|
|
37
37
|
await this._repositoryUsageMetrics.register(usageMetrics);
|
|
38
38
|
return this._success(usageMetrics.correlationId);
|
package/service/utility.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Mutex as asyncMutex } from 'async-mutex';
|
|
|
4
4
|
|
|
5
5
|
import LibraryServerConstants from '@thzero/library_server/constants.js';
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import LibraryMomentUtility from '@thzero/library_common/utility/moment.js';
|
|
8
8
|
|
|
9
9
|
import Service from './index.js';
|
|
10
10
|
|
|
@@ -35,7 +35,7 @@ class UtilityService extends Service {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
async initialize(correlationId) {
|
|
38
|
-
const now =
|
|
38
|
+
const now = LibraryMomentUtility.getTimestamp();
|
|
39
39
|
const ttlInitialize = this._ttlInitialize ? this._ttlInitialize : 0;
|
|
40
40
|
const delta = now - ttlInitialize;
|
|
41
41
|
if (this._initializeResponse && (delta <= this._ttlInitializeDiff))
|
|
@@ -63,7 +63,7 @@ class UtilityService extends Service {
|
|
|
63
63
|
|
|
64
64
|
await this._intialize(correlationId, response);
|
|
65
65
|
|
|
66
|
-
this._ttlInitialize =
|
|
66
|
+
this._ttlInitialize = LibraryMomentUtility.getTimestamp();
|
|
67
67
|
this._initializeResponse = response;
|
|
68
68
|
return response;
|
|
69
69
|
}
|