Skip to content

Commit 53a96cc

Browse files
authored
fix #1911 - CLIENT NO-EVICT (#2124)
1 parent 06c1d2c commit 53a96cc

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

packages/client/lib/client/commands.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import * as CLIENT_GETNAME from '../commands/CLIENT_GETNAME';
2121
import * as CLIENT_GETREDIR from '../commands/CLIENT_GETREDIR';
2222
import * as CLIENT_ID from '../commands/CLIENT_ID';
2323
import * as CLIENT_KILL from '../commands/CLIENT_KILL';
24+
import * as CLIENT_NO_EVICT from '../commands/CLIENT_NO-EVICT';
2425
import * as CLIENT_SETNAME from '../commands/CLIENT_SETNAME';
2526
import * as CLIENT_INFO from '../commands/CLIENT_INFO';
2627
import * as CLUSTER_ADDSLOTS from '../commands/CLUSTER_ADDSLOTS';
@@ -158,6 +159,8 @@ export default {
158159
clientKill: CLIENT_KILL,
159160
CLIENT_SETNAME,
160161
clientSetName: CLIENT_SETNAME,
162+
'CLIENT_NO-EVICT': CLIENT_NO_EVICT,
163+
clientNoEvict: CLIENT_NO_EVICT,
161164
CLIENT_INFO,
162165
clientInfo: CLIENT_INFO,
163166
CLUSTER_ADDSLOTS,
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { strict as assert } from 'assert';
2+
import testUtils, { GLOBAL } from '../test-utils';
3+
import { transformArguments } from './CLIENT_NO-EVICT';
4+
5+
describe('CLIENT NO-EVICT', () => {
6+
testUtils.isVersionGreaterThanHook([7]);
7+
8+
describe('transformArguments', () => {
9+
it('true', () => {
10+
assert.deepEqual(
11+
transformArguments(true),
12+
['CLIENT', 'NO-EVICT', 'ON']
13+
);
14+
});
15+
16+
it('false', () => {
17+
assert.deepEqual(
18+
transformArguments(false),
19+
['CLIENT', 'NO-EVICT', 'OFF']
20+
);
21+
});
22+
});
23+
24+
testUtils.testWithClient('client.clientNoEvict', async client => {
25+
assert.equal(
26+
await client.clientNoEvict(true),
27+
'OK'
28+
);
29+
}, GLOBAL.SERVERS.OPEN);
30+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { RedisCommandArguments } from '.';
2+
3+
export function transformArguments(value: boolean): RedisCommandArguments {
4+
return [
5+
'CLIENT',
6+
'NO-EVICT',
7+
value ? 'ON' : 'OFF'
8+
];
9+
}
10+
11+
export declare function transformReply(): 'OK' | Buffer;

0 commit comments

Comments
 (0)