Skip to content

Commit

Permalink
Don't block main thread when writing access log.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Oct 11, 2015
1 parent 95b44f2 commit c7c493f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion common/log/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ func (logger *fileAccessLogger) close() {
}

func (logger *fileAccessLogger) Log(from, to string, status AccessStatus, reason string) {
logger.queue <- &accessLog{
select {
case logger.queue <- &accessLog{
From: from,
To: to,
Status: status,
Reason: reason,
}:
default:
// We don't expect this to happen, but don't want to block main thread as well.
}
}

Expand Down

0 comments on commit c7c493f

Please sign in to comment.