Skip to content

Commit

Permalink
fix: safety check in backlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
mvayngrib committed May 25, 2018
1 parent 5204b11 commit 85db655
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/backlinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
getPermId,
getResourceIdentifier,
RESOLVED_PROMISE,
isUnsignedType
isUnsignedType,
allSettled
} from './utils'

import {
Expand Down Expand Up @@ -227,7 +228,10 @@ export default class Backlinks {
// context is indexed, so N queries by EQ (with hashKey) are more efficient
// than an IN query that results in a scan
this.logger.silly('searching for applications with contexts', contexts)
return await Promise.map(contexts, this._getApplicationWithContext)
const results = await allSettled(contexts.map(this._getApplicationWithContext))
return results
.filter(result => result.isFulfilled)
.map(result => result.value)
}

private _getApplicationWithContext = async (context:string) => {
Expand Down

0 comments on commit 85db655

Please sign in to comment.