@@ -2,6 +2,7 @@ package dotweb
22
33import (
44 "fmt"
5+ "github.com/devfeel/dotweb/core"
56 "github.com/devfeel/dotweb/framework/convert"
67 "github.com/devfeel/dotweb/framework/exception"
78 "github.com/devfeel/dotweb/framework/json"
@@ -252,7 +253,7 @@ func (server *HttpServer) wrapRouterHandle(handler HttpHandle, isHijack bool) Ro
252253 httpCtx .Response ().SetHeader (HeaderContentEncoding , gzipScheme )
253254 }
254255 //增加状态计数
255- GlobalState .AddRequestCount (1 )
256+ core . GlobalState .AddRequestCount (1 )
256257
257258 //session
258259 //if exists client-sessionid, use it
@@ -308,7 +309,7 @@ func (server *HttpServer) wrapRouterHandle(handler HttpHandle, isHijack bool) Ro
308309 }
309310
310311 //增加错误计数
311- GlobalState .AddErrorCount (1 )
312+ core . GlobalState .AddErrorCount (1 )
312313 }
313314
314315 if server .ServerConfig .EnabledGzip {
@@ -368,7 +369,7 @@ func (server *HttpServer) wrapRouterHandle(handler HttpHandle, isHijack bool) Ro
368369func (server * HttpServer ) wrapFileHandle (fileHandler http.Handler ) RouterHandle {
369370 return func (w http.ResponseWriter , r * http.Request , vnode * ValueNode ) {
370371 //增加状态计数
371- GlobalState .AddRequestCount (1 )
372+ core . GlobalState .AddRequestCount (1 )
372373 startTime := time .Now ()
373374 r .URL .Path = vnode .ByName ("filepath" )
374375 fileHandler .ServeHTTP (w , r )
@@ -408,7 +409,7 @@ func (server *HttpServer) wrapWebSocketHandle(handler HttpHandle) websocket.Hand
408409 logger .Logger ().Log (logString , LogTarget_HttpServer , LogLevel_Error )
409410
410411 //增加错误计数
411- GlobalState .AddErrorCount (1 )
412+ core . GlobalState .AddErrorCount (1 )
412413 }
413414 timetaken := int64 (time .Now ().Sub (startTime ) / time .Millisecond )
414415 //HttpServer Logging
@@ -425,7 +426,7 @@ func (server *HttpServer) wrapWebSocketHandle(handler HttpHandle) websocket.Hand
425426 handler (httpCtx )
426427
427428 //增加状态计数
428- GlobalState .AddRequestCount (1 )
429+ core . GlobalState .AddRequestCount (1 )
429430 }
430431}
431432
0 commit comments