Skip to content

Commit 658f51c

Browse files
megothrubensworks
authored andcommitted
Forgot Promise.all for async
1 parent ee0c2a3 commit 658f51c

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

lib/acl-checker.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -156,31 +156,9 @@ class ACLChecker {
156156
if (!returnAcl) {
157157
throw new HTTPError(500, `No ACL found for ${resource}, searched in \n- ${acls.join('\n- ')}`)
158158
}
159-
// const subject = rdf.sym(acl)
160159
console.log('>>>> GRAPH WITHOUT GROUPS', returnAcl.graph.length)
161-
// const fetcher = new rdf.Fetcher(returnAcl.graph)
162-
// console.log(graph.statementsMatching(null, ACL('agentGroup'), null))
163160
const groupUrls = returnAcl.graph.statementsMatching(null, ACL('agentGroup'), null).map(node => node.object.value.split('#')[0])
164-
// console.log('>>>>>>>>>> GROUPS', groupUrls)
165-
await groupUrls.map(groupUrl => this.fetch(groupUrl, returnAcl.graph))
166-
// const loadingGroups = groupUrls.map(async groupUrl => {
167-
// console.log('STARTING')
168-
// const response = await fetch(groupUrl)
169-
// console.log(response)
170-
// // console.log('>>>>>>>> RESPONSE', response)
171-
// // console.log('AFTER TRY CATCH')
172-
// // const body = await response.text()
173-
// // return new Promise((resolve, reject) => {
174-
// // console.log('WWWAAAAAAAT!!')
175-
// // rdf.parse(body, graph, group, 'text/turtle', err => {
176-
// // if (err) {
177-
// // return reject(err)
178-
// // }
179-
// // resolve()
180-
// // })
181-
// // })
182-
// })
183-
// await Promise.all(loadingGroups)
161+
await Promise.all(groupUrls.map(groupUrl => this.fetch(groupUrl, returnAcl.graph)))
184162
console.log('>>>> GRAPH WITH GROUPS', returnAcl.graph.length)
185163

186164
return returnAcl

0 commit comments

Comments
 (0)