Skip to content

Commit c79a6bd

Browse files
committed
Ensure clients actually exit
1 parent 77f1750 commit c79a6bd

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.14.2 (2020-07-30)
4+
5+
* Ensure clients actually exit when a 'CLIENT KILL' command is received
6+
37
## 0.14.1 (2020-07-30)
48

59
* Ensure clients can poll, by listening with (while) instead of (when)

commands.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
[de kv-cmd-client-kill (Filter Arg)
4646
(case (uppc Filter)
47-
["ID" (length (make (mapcar '((N) (when (= Arg (cdr (assoc "id" (cadr N)))) (kv-remove-client (car N)) (link T))) (get (kv-value "%stats%/connected_clients") ]
47+
["ID" (length (make (mapcar '((N) (when (= Arg (cdr (assoc "id" (cadr N)))) (kv-remove-client (car N) T) (link T))) (get (kv-value "%stats%/connected_clients") ]
4848
(T 0) ]
4949

5050
[de kv-cmd-client-list ()

module.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[de APP_INFO
22
("name" "picolisp-kv")
3-
("version" "0.14.1")
3+
("version" "0.14.2")
44
("summary" "Redis-inspired in-memory key/value store written in PicoLisp")
55
("source" "https://github.com/aw/picolisp-kv")
66
("author" "Alexander Williams")

sibling.l

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
(out Pipe_child (pr (cons "message" Result) ]
1717

1818
# Remove the child's process ID from the list of connected clients
19-
[de kv-remove-client (Pid)
19+
[de kv-remove-client (Pid Kill)
20+
(when Kill (kill Pid))
2021
(kv-stat "connected_clients" (filter '((N) (unless (= (car N) Pid) N)) *KV/%stats%/connected_clients))
2122
NIL ] # NIL breaks from (kv-sibling-loop)
2223

0 commit comments

Comments
 (0)