Skip to content

Commit

Permalink
Rollback changes to wp source files
Browse files Browse the repository at this point in the history
  • Loading branch information
TJ Simons committed Mar 23, 2018
1 parent 4c30e8b commit b8e5fe6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 36 deletions.
3 changes: 0 additions & 3 deletions packages/gatsby-source-wordpress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ plugins: [
sourceUrl: "https://source-url.com",
replacementUrl: "https://replacement-url.com",
},
// How many media objects should be downloaded in parallel. Higher = faster
// OSX defaults to 256 max open connections, you cannot surpass that unless you increase the restriction
chunkSize: 100,
},
},
];
Expand Down
2 changes: 0 additions & 2 deletions packages/gatsby-source-wordpress/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ exports.sourceNodes = async (
verboseOutput,
perPage = 100,
searchAndReplaceContentUrls = {},
chunkSize = 100,
}
) => {
const { createNode } = boundActionCreators
Expand Down Expand Up @@ -93,7 +92,6 @@ exports.sourceNodes = async (
cache,
createNode,
_auth,
chunkSize,
})

// Search and replace Content Urls
Expand Down
32 changes: 1 addition & 31 deletions packages/gatsby-source-wordpress/src/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ exports.mapEntitiesToMedia = entities => {
}

// Downloads media files and removes "sizes" data as useless in Gatsby context.
const downloadMediaFilesChunk = async ({
exports.downloadMediaFiles = async ({
entities,
store,
cache,
Expand Down Expand Up @@ -412,36 +412,6 @@ const downloadMediaFilesChunk = async ({
})
)

// chunk the entities from the wordpress /media/ endpoint and process them as noted above
exports.downloadMediaFiles = async ({
entities,
store,
cache,
createNode,
_auth,
chunkSize,
}) => {
const chunks = _.chunk(entities, chunkSize)
let processed = []

while (chunks.length) {
const chunk = chunks.shift()

const entitiesChunk = await downloadMediaFilesChunk({
entities: chunk,
store,
cache,
createNode,
_auth,
chunkSize,
})

processed = processed.concat(entitiesChunk)
}

return processed
}

const prepareACFChildNodes = (
obj,
entityId,
Expand Down

0 comments on commit b8e5fe6

Please sign in to comment.