@seidor-cloud-produtos/orbit-backend-lib 0.0.86 → 0.0.89
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,7 +2,7 @@ export declare abstract class CacheClient {
|
|
|
2
2
|
abstract start(): Promise<void>;
|
|
3
3
|
abstract close(): Promise<void>;
|
|
4
4
|
abstract get(keyCache: string): Promise<any>;
|
|
5
|
-
abstract set(keyCache: string, data: any, expiration
|
|
5
|
+
abstract set(keyCache: string, data: any, expiration?: number): Promise<void>;
|
|
6
6
|
abstract del(keyCache: string): Promise<void>;
|
|
7
7
|
abstract delBatch(keyCache: string[]): Promise<void>;
|
|
8
8
|
abstract getKeys(pattern?: string): Promise<string[] | null>;
|
|
@@ -7,7 +7,7 @@ export declare class Redis extends CacheClient {
|
|
|
7
7
|
private static delayOperation;
|
|
8
8
|
start(): Promise<void>;
|
|
9
9
|
get(key: string): Promise<any>;
|
|
10
|
-
set(key: string, data: string, expiration
|
|
10
|
+
set(key: string, data: string, expiration?: number): Promise<void>;
|
|
11
11
|
del(keyCache: string): Promise<void>;
|
|
12
12
|
delBatch(keyCache: string[]): Promise<void>;
|
|
13
13
|
getKeys(pattern?: string | undefined): Promise<string[] | null>;
|
|
@@ -12,7 +12,6 @@ class Redis extends client_1.CacheClient {
|
|
|
12
12
|
static async delayOperation() {
|
|
13
13
|
const maxDelayMs = 5000;
|
|
14
14
|
await new Promise(resolve => setTimeout(resolve, maxDelayMs));
|
|
15
|
-
console.log('TIMEOUT ON REDIS OPERATION');
|
|
16
15
|
return null;
|
|
17
16
|
}
|
|
18
17
|
async start() {
|
|
@@ -31,7 +30,9 @@ class Redis extends client_1.CacheClient {
|
|
|
31
30
|
async set(key, data, expiration) {
|
|
32
31
|
const set = async () => {
|
|
33
32
|
await this.client.set(key, data);
|
|
34
|
-
|
|
33
|
+
if (expiration) {
|
|
34
|
+
await this.client.expire(key, expiration);
|
|
35
|
+
}
|
|
35
36
|
};
|
|
36
37
|
// If redis not connected the set method never returns
|
|
37
38
|
await Promise.race([set(), Redis.delayOperation()]);
|
package/dist/static/ddd.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DDD } from '
|
|
1
|
+
import { DDD } from '../clean-arch/domain/interfaces/ddd';
|
|
2
2
|
export declare const ddds: Array<DDD>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seidor-cloud-produtos/orbit-backend-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.89",
|
|
4
4
|
"description": "Internal lib for backend components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -90,4 +90,4 @@
|
|
|
90
90
|
"tslib": "2.6.2",
|
|
91
91
|
"zod": "3.23.8"
|
|
92
92
|
}
|
|
93
|
-
}
|
|
93
|
+
}
|