Fix error log when loading issues caused by a xorm bug (#7271)
* fix error log when loading issues caused by a xorm bug * upgrade packages * fix fmt * fix Consistency * fix tests
This commit is contained in:
parent
baefea311f
commit
aa7c34cf86
156 changed files with 1854 additions and 1833 deletions
17
vendor/google.golang.org/appengine/internal/api.go
generated
vendored
17
vendor/google.golang.org/appengine/internal/api.go
generated
vendored
|
@ -3,7 +3,6 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !appengine
|
||||
// +build go1.7
|
||||
|
||||
package internal
|
||||
|
||||
|
@ -130,7 +129,13 @@ func handleHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
flushes++
|
||||
}
|
||||
c.pendingLogs.Unlock()
|
||||
go c.flushLog(false)
|
||||
flushed := make(chan struct{})
|
||||
go func() {
|
||||
defer close(flushed)
|
||||
// Force a log flush, because with very short requests we
|
||||
// may not ever flush logs.
|
||||
c.flushLog(true)
|
||||
}()
|
||||
w.Header().Set(logFlushHeader, strconv.Itoa(flushes))
|
||||
|
||||
// Avoid nil Write call if c.Write is never called.
|
||||
|
@ -140,6 +145,9 @@ func handleHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
if c.outBody != nil {
|
||||
w.Write(c.outBody)
|
||||
}
|
||||
// Wait for the last flush to complete before returning,
|
||||
// otherwise the security ticket will not be valid.
|
||||
<-flushed
|
||||
}
|
||||
|
||||
func executeRequestSafely(c *context, r *http.Request) {
|
||||
|
@ -571,7 +579,10 @@ func logf(c *context, level int64, format string, args ...interface{}) {
|
|||
Level: &level,
|
||||
Message: &s,
|
||||
})
|
||||
log.Print(logLevelName[level] + ": " + s)
|
||||
// Only duplicate log to stderr if not running on App Engine second generation
|
||||
if !IsSecondGen() {
|
||||
log.Print(logLevelName[level] + ": " + s)
|
||||
}
|
||||
}
|
||||
|
||||
// flushLog attempts to flush any pending logs to the appserver.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue