Comparing version 2.0.0 to 2.0.1
2.0.1 / 2017-02-15 | ||
================== | ||
* fix: context loader cache independent in each request (#54) | ||
2.0.0 / 2017-02-10 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -48,9 +48,2 @@ 'use strict'; | ||
const app = this.options.inject; | ||
// distinguish property cache | ||
// e.x. ctx.service1 and ctx.service2 have different cache | ||
if (!this[CLASSLOADER]) { | ||
this[CLASSLOADER] = new Map(); | ||
} | ||
const classLoader = this[CLASSLOADER]; | ||
const property = options.property; | ||
@@ -61,2 +54,10 @@ | ||
get() { | ||
// distinguish property cache, | ||
// cache's lifecycle is the same with this context instance | ||
// e.x. ctx.service1 and ctx.service2 have different cache | ||
if (!this[CLASSLOADER]) { | ||
this[CLASSLOADER] = new Map(); | ||
} | ||
const classLoader = this[CLASSLOADER]; | ||
let instance = classLoader.get(property); | ||
@@ -63,0 +64,0 @@ if (!instance) { |
{ | ||
"name": "egg-core", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A core Pluggable framework based on koa", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71069
1880