Skip to content

Commit

Permalink
cleanup map on complete
Browse files Browse the repository at this point in the history
  • Loading branch information
wardpeet committed Nov 22, 2019
1 parent 94d38fc commit 0c2ce93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/gatsby-plugin-sharp/src/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jest.mock(`async/queue`, () => () => {
})

const { scheduleJob } = require(`../scheduler`)
scheduleJob.mockReturnValue(Promise.resolve())
fs.ensureDirSync = jest.fn()
fs.existsSync = jest.fn().mockReturnValue(false)
let isolatedQueueImageResizing
Expand Down
6 changes: 5 additions & 1 deletion packages/gatsby-plugin-sharp/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ function queueImageResizing({ file, args = {}, reporter }) {
boundActionCreators,
pluginOptions,
reporter
)
).then(res => {
cachedOutputFiles.delete(outputFile)

return res
})

cachedOutputFiles.set(outputFile, finishedPromise)
}
Expand Down

0 comments on commit 0c2ce93

Please sign in to comment.