Skip to content

Commit 916c3f6

Browse files
committed
Fix multiple reload of endpoints in ServiceRunner
1 parent 841a879 commit 916c3f6

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/service/service-runner.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ class ServiceRunner {
2828
debug('starting endpoints')
2929

3030
const eps = Hoek.reach(this.service, 'compiled.endpoints')
31-
const endpointsLoading = []
31+
//const endpointsLoading = []
3232
for(let name in eps){
3333
debug('\t',name)
34-
endpointsLoading.push( this.loadEndpoint(name) )
34+
await this.loadEndpoint(name)
35+
//endpointsLoading.push( this.loadEndpoint(name) )
3536
}
3637

37-
await Promise.all(endpointsLoading)
38+
//await Promise.all(endpointsLoading)
3839
debug('endpoints ready:')
3940
for(let name in this.endpoint){
4041
debug('\t', Path.join('/', name))
@@ -86,6 +87,7 @@ class ServiceRunner {
8687

8788
async loadMiddleware(name, type='pre'){
8889
if(this.middleware[type][name]){
90+
debug('cached',type,'middleware',name)
8991
return this.middleware[type][name]
9092
}
9193

@@ -107,7 +109,7 @@ class ServiceRunner {
107109
this.middleware[type][name] = runner
108110

109111
dt.end()
110-
debug('loaded middleware',name,'in',dt.deltaMs,'ms')
112+
debug('loaded',type,'middleware',name,'in',dt.deltaMs,'ms')
111113

112114
return runner
113115
}

0 commit comments

Comments
 (0)