Skip to content

Commit

Permalink
chore: move run-sift (gatsbyjs#9549)
Browse files Browse the repository at this point in the history
* Add nodes namespace to support loki feature flag

* naughty console log

* switch for db nodes backend

* move connection out of run-sift

* revert snapshot for gatsby-remark-embed

* typo

* move node tracking into DB

* move run-sift into redux

* use runQuery instead of runSift

* add caching of getNodesByType in run-sift

* fix docs
  • Loading branch information
Moocar authored Nov 6, 2018
1 parent 2df7e38 commit 06e6bbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ createRemoteFileNode({

// OPTIONAL
// Sets the file extension
ext: '.jpg',
ext: ".jpg",
})
```

Expand Down Expand Up @@ -240,6 +240,6 @@ createRemoteFileNode({
createNode,
createNodeId,
// if necessary!
ext: '.jpg',
ext: ".jpg",
})
```
8 changes: 2 additions & 6 deletions src/create-remote-file-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,15 @@ async function processRemoteNode({

// Create the temp and permanent file names for the url.
const digest = createHash(url)
if (!ext){
if (!ext) {
ext = getRemoteFileExtension(url)
}

const tmpFilename = createFilePath(programDir, `tmp-${digest}`, ext)

// Fetch the file.
try {
const response = await requestRemoteNode(
url,
headers,
tmpFilename,
)
const response = await requestRemoteNode(url, headers, tmpFilename)
// Save the response headers for future requests.
await cache.set(cacheId(url), response.headers)

Expand Down

0 comments on commit 06e6bbc

Please sign in to comment.