@volter/world-core 3.0.101 → 3.0.102
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/src/redis/stream.js +3 -1
- package/package.json +1 -1
- package/src/redis/stream.ts +3 -1
package/dist/src/redis/stream.js
CHANGED
|
@@ -159,8 +159,10 @@ export function createRedisStream(options) {
|
|
|
159
159
|
}
|
|
160
160
|
answer(s, s.subscriptions.size + s.patterns.size ? ['pong', a[0] ?? ''] : a.length ? a[0] : new RedisStatus('PONG'));
|
|
161
161
|
return;
|
|
162
|
+
// source: https://raw.githubusercontent.com/redis/redis/c9d29f6a918c335bc1778d9f68e521c1bbb36a0f/src/server.c "process_id:%I" (genRedisInfoString, # Server): the serving process's pid, which a supervisor reads to know the server it reached is the one it started
|
|
162
163
|
case 'INFO': {
|
|
163
|
-
const
|
|
164
|
+
const pid = globalThis.process?.pid ?? 0;
|
|
165
|
+
const blocks = { server: `# Server\r\nredis_version:${options.version}\r\nredis_mode:standalone\r\nprocess_id:${pid}\r\n`, clients: `# Clients\r\nconnected_clients:${sessions.size}\r\nblocked_clients:${[...sessions].filter((x) => x.blocked).length}\r\n`, memory: `# Memory\r\nmaxmemory:0\r\nmaxmemory_policy:noeviction\r\n`, stats: `# Stats\r\ntotal_connections_received:${nextId}\r\ntotal_commands_processed:${commandCount}\r\n`, persistence: '# Persistence\r\nloading:0\r\n' };
|
|
164
166
|
answer(s, a.length && !['ALL', 'DEFAULT'].includes(a[0].toUpperCase()) ? a.map((x) => blocks[x.toLowerCase()] ?? '').join('') : Object.values(blocks).join('\r\n'));
|
|
165
167
|
return;
|
|
166
168
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/world-core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.102",
|
|
4
4
|
"description": "The kernel of Volter World: one log per twin, branches as pointers, checkpoints, the fold that keeps a twin current, the head that performs a write against the vendor, references, and the git plane. A twin package builds on it; the runtime serves it.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"twin",
|
package/src/redis/stream.ts
CHANGED
|
@@ -55,8 +55,10 @@ export function createRedisStream(options: RedisStreamOptions): TwinStream {
|
|
|
55
55
|
}
|
|
56
56
|
// source: https://raw.githubusercontent.com/redis/redis/c9d29f6a918c335bc1778d9f68e521c1bbb36a0f/src/server.c "It works in a different way if the client is in"
|
|
57
57
|
case 'PING': if (a.length > 1) { answer(s, error("ERR wrong number of arguments for 'ping' command")); return; } answer(s, s.subscriptions.size + s.patterns.size ? ['pong', a[0] ?? ''] : a.length ? a[0] : new RedisStatus('PONG')); return;
|
|
58
|
+
// source: https://raw.githubusercontent.com/redis/redis/c9d29f6a918c335bc1778d9f68e521c1bbb36a0f/src/server.c "process_id:%I" (genRedisInfoString, # Server): the serving process's pid, which a supervisor reads to know the server it reached is the one it started
|
|
58
59
|
case 'INFO': {
|
|
59
|
-
const
|
|
60
|
+
const pid = (globalThis as { process?: { pid?: number } }).process?.pid ?? 0;
|
|
61
|
+
const blocks: Record<string, string> = { server: `# Server\r\nredis_version:${options.version}\r\nredis_mode:standalone\r\nprocess_id:${pid}\r\n`, clients: `# Clients\r\nconnected_clients:${sessions.size}\r\nblocked_clients:${[...sessions].filter((x) => x.blocked).length}\r\n`, memory: `# Memory\r\nmaxmemory:0\r\nmaxmemory_policy:noeviction\r\n`, stats: `# Stats\r\ntotal_connections_received:${nextId}\r\ntotal_commands_processed:${commandCount}\r\n`, persistence: '# Persistence\r\nloading:0\r\n' };
|
|
60
62
|
answer(s, a.length && !['ALL', 'DEFAULT'].includes(a[0]!.toUpperCase()) ? a.map((x) => blocks[x.toLowerCase()] ?? '').join('') : Object.values(blocks).join('\r\n')); return;
|
|
61
63
|
}
|
|
62
64
|
case 'MULTI': if (s.queue) answer(s, error('ERR MULTI calls can not be nested')); else { s.queue = []; s.dirty = false; answer(s, ok); } return;
|