Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wardpeet committed Jan 24, 2019
1 parent e7b8551 commit 425b445
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 1 addition & 6 deletions packages/gatsby-plugin-sharp/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
/index.js
/node_modules
/gatsby-node.js
/duotone.js
/queue.js
/processFile.js
/scheduler.js
/*.js
5 changes: 4 additions & 1 deletion packages/gatsby-plugin-sharp/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ let promises = []
exports.onPreBuild = async ({ cache, boundActionCreators }, pluginOptions) => {
const cachedQueue = await getQueueFromCache(cache)

let promises = []
for (const [, job] of cachedQueue) {
promises.push(scheduleJob(job, boundActionCreators, pluginOptions))
}
Expand Down Expand Up @@ -74,6 +73,10 @@ exports.onCreateDevServer = ({ app, cache }, pluginOptions) => {

// wait until the file has been processed and saved to disk
await Promise.all(processFile(job.file.absolutePath, [job], pluginOptions))
queue.delete(req.originalUrl)

// JSON.stringify doesn't work on an Map so we need to convert it to an array
cache.set(`queue`, Array.from(queue))

return res.sendFile(job.outputPath)
})
Expand Down

0 comments on commit 425b445

Please sign in to comment.