File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -100,4 +100,8 @@ export default class Config {
100
100
static get OSS_EXTERNAL_ENDPOINT ( ) : string {
101
101
return process . env . OSS_EXTERNAL_ENDPOINT
102
102
}
103
+
104
+ static get ENABLE_MODULE_CACHE ( ) : boolean {
105
+ return process . env . ENABLE_MODULE_CACHE === 'true' || false
106
+ }
103
107
}
Original file line number Diff line number Diff line change
1
+ import Config from '../../config'
1
2
import { FunctionCache } from './cache'
2
3
import { FunctionContext } from './types'
3
4
import { buildSandbox , createScript } from './utils'
@@ -36,7 +37,9 @@ export class FunctionModule {
36
37
)
37
38
38
39
// cache module
39
- FunctionModule . cache . set ( name , functionModule )
40
+ if ( Config . ENABLE_MODULE_CACHE ) {
41
+ FunctionModule . cache . set ( name , functionModule )
42
+ }
40
43
return functionModule
41
44
}
42
45
return require ( name )
You can’t perform that action at this time.
0 commit comments