accesslog
This commit is contained in:
@@ -30,7 +30,8 @@ func (v01 *V01) _listen() {
|
|||||||
s := &http.Server{
|
s := &http.Server{
|
||||||
Addr: v01.cfg.Feedback.Addr,
|
Addr: v01.cfg.Feedback.Addr,
|
||||||
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
log.Printf("%s", r.URL.String())
|
start := time.Now()
|
||||||
|
defer func() { log.Printf("%vms | %s %s", time.Since(start).Milliseconds(), r.Method, r.URL) }()
|
||||||
v01.cfg.lock.Lock()
|
v01.cfg.lock.Lock()
|
||||||
defer v01.cfg.lock.Unlock()
|
defer v01.cfg.lock.Unlock()
|
||||||
if r.Method == http.MethodGet {
|
if r.Method == http.MethodGet {
|
||||||
@@ -279,8 +280,8 @@ func (v01 *V01) serveGMElect(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v01 *V01) serveGMVote(w http.ResponseWriter, r *http.Request) {
|
func (v01 *V01) serveGMVote(w http.ResponseWriter, r *http.Request) {
|
||||||
switch r.Method {
|
switch r.URL.Query().Get("payload") {
|
||||||
case http.MethodGet:
|
case "":
|
||||||
counts := map[string]string{}
|
counts := map[string]string{}
|
||||||
for k, v := range v01.cfg.Users {
|
for k, v := range v01.cfg.Users {
|
||||||
if v.State.GM.Vote != "" {
|
if v.State.GM.Vote != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user