Skip to content

Commit

Permalink
update comment in hit_controller.ex for clarity #79
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Jun 1, 2019
1 parent dee8add commit b1f3ad1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/hits_web/controllers/hit_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ defmodule HitsWeb.HitController do
# insert the useragent:
useragent_id = Useragent.insert(%Useragent{name: useragent, ip: ip})

#
# extract GitHub username from params so it can be saved & sent via channel:
username = params["user"]
# insert the user:
user_id = User.insert(%User{name: username})
Expand All @@ -51,7 +51,7 @@ defmodule HitsWeb.HitController do
hit_attrs = %Hit{repo_id: repository_id, useragent_id: useragent_id}
count = Hit.insert(hit_attrs)

# send hit to connected clients via channel (websocket)
# Send hit to connected clients via channel github.com/dwyl/hits/issues/79
HitsWeb.Endpoint.broadcast("hit:lobby", "hit",
%{"user" => username, "repo" => repository, "count" => count})

Expand Down

0 comments on commit b1f3ad1

Please sign in to comment.