accesslog

master v0.1.8
bel 2023-03-27 21:39:07 -06:00
parent 09d9911293
commit a36f07d0c1
1 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,8 @@ func (v01 *V01) _listen() {
s := &http.Server{
Addr: v01.cfg.Feedback.Addr,
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()
defer v01.cfg.lock.Unlock()
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) {
switch r.Method {
case http.MethodGet:
switch r.URL.Query().Get("payload") {
case "":
counts := map[string]string{}
for k, v := range v01.cfg.Users {
if v.State.GM.Vote != "" {