magmastream 2.9.3-dev.19 → 2.9.3-dev.20
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/dist/index.d.ts +0 -7
- package/dist/structures/Node.js +0 -18
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2533,7 +2533,6 @@ declare class Node {
|
|
|
2533
2533
|
private reconnectTimeout?;
|
|
2534
2534
|
private reconnectAttempts;
|
|
2535
2535
|
private redisPrefix?;
|
|
2536
|
-
private sessionIdsFilePath?;
|
|
2537
2536
|
private sessionIdsMap;
|
|
2538
2537
|
/**
|
|
2539
2538
|
* Creates an instance of Node.
|
|
@@ -2552,12 +2551,6 @@ declare class Node {
|
|
|
2552
2551
|
private getRedisSessionIdsKey;
|
|
2553
2552
|
private getNodeSessionsDir;
|
|
2554
2553
|
private getNodeSessionPath;
|
|
2555
|
-
/**
|
|
2556
|
-
* Creates the sessionIds.json file if it doesn't exist. This file is used to
|
|
2557
|
-
* store the session IDs for each node. The session IDs are used to identify
|
|
2558
|
-
* the node when resuming a session.
|
|
2559
|
-
*/
|
|
2560
|
-
createSessionIdsFile(): void;
|
|
2561
2554
|
/**
|
|
2562
2555
|
* Loads session IDs from the sessionIds.json file if it exists.
|
|
2563
2556
|
* The session IDs are used to resume sessions for each node.
|
package/dist/structures/Node.js
CHANGED
|
@@ -31,7 +31,6 @@ class Node {
|
|
|
31
31
|
reconnectTimeout;
|
|
32
32
|
reconnectAttempts = 1;
|
|
33
33
|
redisPrefix;
|
|
34
|
-
sessionIdsFilePath;
|
|
35
34
|
sessionIdsMap = new Map();
|
|
36
35
|
/**
|
|
37
36
|
* Creates an instance of Node.
|
|
@@ -97,12 +96,6 @@ class Node {
|
|
|
97
96
|
switch (this.manager.options.stateStorage.type) {
|
|
98
97
|
case Enums_1.StateStorageType.Memory:
|
|
99
98
|
case Enums_1.StateStorageType.JSON:
|
|
100
|
-
this.sessionIdsFilePath = path_1.default.join(process.cwd(), "magmastream", "sessionData", "sessionIds.json");
|
|
101
|
-
const configDir = path_1.default.dirname(this.sessionIdsFilePath);
|
|
102
|
-
if (!fs_1.default.existsSync(configDir)) {
|
|
103
|
-
fs_1.default.mkdirSync(configDir, { recursive: true });
|
|
104
|
-
}
|
|
105
|
-
this.createSessionIdsFile();
|
|
106
99
|
this.createReadmeFile();
|
|
107
100
|
break;
|
|
108
101
|
case Enums_1.StateStorageType.Redis:
|
|
@@ -138,17 +131,6 @@ class Node {
|
|
|
138
131
|
const safeId = String(this.options.identifier).replace(/[^a-zA-Z0-9._-]/g, "_");
|
|
139
132
|
return path_1.default.join(this.getNodeSessionsDir(), `${safeId}.txt`);
|
|
140
133
|
}
|
|
141
|
-
/**
|
|
142
|
-
* Creates the sessionIds.json file if it doesn't exist. This file is used to
|
|
143
|
-
* store the session IDs for each node. The session IDs are used to identify
|
|
144
|
-
* the node when resuming a session.
|
|
145
|
-
*/
|
|
146
|
-
createSessionIdsFile() {
|
|
147
|
-
if (!fs_1.default.existsSync(this.sessionIdsFilePath)) {
|
|
148
|
-
this.manager.emit(Enums_1.ManagerEventTypes.Debug, `[NODE] Creating sessionId file at: ${this.sessionIdsFilePath}`);
|
|
149
|
-
fs_1.default.writeFileSync(this.sessionIdsFilePath, Utils_1.JSONUtils.safe({}), "utf-8");
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
134
|
/**
|
|
153
135
|
* Loads session IDs from the sessionIds.json file if it exists.
|
|
154
136
|
* The session IDs are used to resume sessions for each node.
|