-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
- [[../redis|redis]] | ||
```sh | ||
[ErrorReply: ERR Can't execute 'zincrby': only (P|S)SUBSCRIBE / (P|S)UNSUBSCRIBE / PING / QUIT / RESET are allowed in this context] | ||
``` | ||
- pub, sub 을 이용하는 경우 클라이언트 인스턴스를 분리해야한다 | ||
- [[../redis|redis]] 는 [[../postgresql|postgresql]] 과는 다르게 기본 env 설정을 읽거나 하지 않는다. 인자로 명시한다 | ||
- 기본설정에 이벤트가 꺼져있다면 런타임에 `CONFIG SET` 을 통해 설정해줘야한다 | ||
```javascript | ||
await client.configSet('notify-keyspace-events', 'Ex') | ||
await client.subscribe('__keyevent@0__:expired', (message, channel) => { | ||
console.log({ message, channel }) | ||
}) | ||
``` | ||
- `setEx` = `set` + expire |