File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,11 @@ export class ScopedActionService {
63
63
if ( key . toLowerCase ( ) . indexOf ( `/actions` ) > - 1 ) {
64
64
this . _scriptsCache . clear ( )
65
65
this . _actionsCache = undefined
66
+
67
+ // Clearing cache for files required in actions
68
+ Object . keys ( require . cache )
69
+ . filter ( r => r . match ( / ( \\ | \/ ) a c t i o n s ( \\ | \/ ) / g) )
70
+ . map ( file => delete require . cache [ file ] )
66
71
}
67
72
} )
68
73
}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { IO } from 'botpress/sdk'
3
3
import { ObjectCache } from 'common/object-cache'
4
4
import { UntrustedSandbox } from 'core/misc/code-sandbox'
5
5
import { printObject } from 'core/misc/print'
6
+ import { WorkspaceUserAttributes } from 'core/repositories/workspace_users'
6
7
import { inject , injectable , tagged } from 'inversify'
7
8
import _ from 'lodash'
8
9
import path from 'path'
@@ -13,7 +14,6 @@ import { requireAtPaths } from '../../modules/require'
13
14
import { TYPES } from '../../types'
14
15
import { VmRunner } from '../action/vm'
15
16
import { Incident } from '../alerting-service'
16
- import { WorkspaceUserAttributes } from 'core/repositories/workspace_users'
17
17
18
18
const debug = DEBUG ( 'hooks' )
19
19
@@ -144,6 +144,11 @@ export class HookService {
144
144
if ( key . toLowerCase ( ) . indexOf ( `/hooks/` ) > - 1 ) {
145
145
// clear the cache if there's any file that has changed in the `hooks` folder
146
146
this . _scriptsCache . clear ( )
147
+
148
+ // Clearing cache for files required in hooks
149
+ Object . keys ( require . cache )
150
+ . filter ( r => r . match ( / ( \\ | \/ ) h o o k s ( \\ | \/ ) / g) )
151
+ . map ( file => delete require . cache [ file ] )
147
152
}
148
153
} )
149
154
}
You can’t perform that action at this time.
0 commit comments