1 local key_socket
= KEYS
[1];
2 local key_active_sockets
= KEYS
[2];
3 local key_user_sockets
= KEYS
[3];
5 local socket_id
= ARGV
[1];
7 local socket_del_result
= redis
.call("SREM", key_active_sockets
, socket_id
)
8 redis
.call("SREM", key_user_sockets
, socket_id
)
10 -- If the socket doesn't exist, return with a failure code
11 if redis
.call("EXISTS", key_socket
) == 0 then
12 return { 0, socket_del_result
}
16 redis
.call("DEL", key_socket
)
18 return { 1, socket_del_result
}