diff --git a/engine.go b/engine.go index 68dcbae3..89a96d9f 100644 --- a/engine.go +++ b/engine.go @@ -45,7 +45,6 @@ type Engine struct { DatabaseTZ *time.Location // The timezone of the database disableGlobalCache bool - enableContextCache bool tagHandlers map[string]tagHandler @@ -314,11 +313,6 @@ func (engine *Engine) NewSession() *Session { return session } -// EnableContextCache will enable or disable context cache -func (engine *Engine) EnableContextCache(enabled bool) { - engine.enableContextCache = enabled -} - // Close the engine func (engine *Engine) Close() error { return engine.db.Close() diff --git a/session_context.go b/session_context.go deleted file mode 100644 index 510c8b48..00000000 --- a/session_context.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2018 The Xorm Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xorm - -import ( - "context" -) - -type cacheContext struct { - context.Context - values map[string]interface{} -} - -func (c *cacheContext) Done() <-chan struct{} { - for k := range c.values { - delete(c.values, k) - } - return nil -} - -func (c *cacheContext) Value(key interface{}) interface{} { - return c.values[key.(string)] -} - -func WithCacher(ctx context.Context) context.Context { - return &cacheContext{ - Context: ctx, - values: make(map[string]interface{}), - } -}