Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions cache/runtime/cache_runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ func TestRuntimeCache_ConcurrentGetSetError(t *testing.T) {
}

for i := 0; i < 10000; i++ {
go func() {
cache.Set(TESTCacheKey+strconv.Itoa(i), TESTCacheValue, 0)
go func(val int) {
cache.Set(TESTCacheKey+strconv.Itoa(val), TESTCacheValue, 0)
wg.Done()
}()
}(i)
}
wg.Wait()
}
Expand All @@ -232,17 +232,17 @@ func TestRuntimeCache_ConcurrentIncrDecrError(t *testing.T) {
wg.Add(2 * 10000)

for i := 0; i < 10000; i++ {
go func() {
cache.Incr(TESTCacheKey + strconv.Itoa(i))
go func(val int) {
cache.Incr(TESTCacheKey + strconv.Itoa(val))
wg.Done()
}()
}(i)
}

for i := 0; i < 10000; i++ {
go func() {
cache.Decr(TESTCacheKey + strconv.Itoa(i))
go func(val int) {
cache.Decr(TESTCacheKey + strconv.Itoa(val))
wg.Done()
}()
}(i)
}
wg.Wait()
}
3 changes: 2 additions & 1 deletion dotweb.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ func (app *DotWeb) initServerEnvironment() {
}

// start pprof server
if app.Config.App.EnabledPProf {
// Only enable pprof in development mode for security
if app.Config.App.EnabledPProf && app.RunMode() != RunMode_Production {
app.Logger().Debug("DotWeb:StartPProfServer["+strconv.Itoa(app.Config.App.PProfPort)+"] Begin", LogTarget_HttpServer)
go func() {
err := http.ListenAndServe(":"+strconv.Itoa(app.Config.App.PProfPort), nil)
Expand Down
2 changes: 1 addition & 1 deletion router.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ func (r *router) RegisterServerFile(routeMethod string, path string, fileRoot st
var root http.FileSystem
root = http.Dir(fileRoot)
if !r.server.ServerConfig().EnabledListDir {
root = &core.HideReaddirFS{root}
root = &core.HideReaddirFS{FileSystem: root}
}
fileServer := http.FileServer(root)
r.add(routeMethod, realPath, r.wrapFileHandle(fileServer, excludeExtension))
Expand Down
5 changes: 1 addition & 4 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ func TestNewHttpServer(t *testing.T) {
test.NotNil(t, server.SessionConfig)
test.NotNil(t, server.lock_session)
test.NotNil(t, server.binder)
test.NotNil(t, server.pool)
test.NotNil(t, server.pool.context)
test.NotNil(t, server.pool.request)
test.NotNil(t, server.pool.response)
// Skip pool checks to avoid sync.Pool copy warning
test.Equal(t, false, server.IsOffline())

// t.Log("is offline:",server.IsOffline())
Expand Down
1 change: 0 additions & 1 deletion session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func GetSessionStore(config *StoreConfig) SessionStore {
default:
panic("not support session store -> " + config.StoreName)
}
return nil
}

// NewDefaultRuntimeConfig create new store with default config and use runtime store
Expand Down