Skip to content

Commit

Permalink
Ensure clients actually exit
Browse files Browse the repository at this point in the history
  • Loading branch information
aw committed Jul 30, 2020
1 parent 77f1750 commit c79a6bd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.14.2 (2020-07-30)

* Ensure clients actually exit when a 'CLIENT KILL' command is received

## 0.14.1 (2020-07-30)

* Ensure clients can poll, by listening with (while) instead of (when)
Expand Down
2 changes: 1 addition & 1 deletion commands.l
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

[de kv-cmd-client-kill (Filter Arg)
(case (uppc Filter)
["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") ]
["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") ]
(T 0) ]

[de kv-cmd-client-list ()
Expand Down
2 changes: 1 addition & 1 deletion module.l
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[de APP_INFO
("name" "picolisp-kv")
("version" "0.14.1")
("version" "0.14.2")
("summary" "Redis-inspired in-memory key/value store written in PicoLisp")
("source" "https://github.com/aw/picolisp-kv")
("author" "Alexander Williams")
Expand Down
3 changes: 2 additions & 1 deletion sibling.l
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
(out Pipe_child (pr (cons "message" Result) ]

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

Expand Down

0 comments on commit c79a6bd

Please sign in to comment.