Skip to content

Instantly share code, notes, and snippets.

@greggy
Created February 14, 2013 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greggy/4953482 to your computer and use it in GitHub Desktop.
Save greggy/4953482 to your computer and use it in GitHub Desktop.
{ok, Viewers} = eredis:q(State#state.redis_pool, ["HGET", "channel:clients", Key]),
ViewersInt = list_to_integer(binary_to_list(Viewers)),
case ViewersInt > 0 of
true ->
eredis:q(State#state.redis_pool, ["HSET", "channel:clients", Key, 0]),
?D([Key, ViewersInt]),
net_pinger:set_billing(binary_to_list(Key), ViewersInt);
_ -> ok
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment