Skip to content

Commit

Permalink
fix: failing english builds (#1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
scissorsneedfoodtoo authored Dec 15, 2024
1 parent 1dd4be2 commit 90b134c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-eng.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18.x]
node-version: [20.x]
languages: [english]
site_tlds: [org]

Expand Down
9 changes: 6 additions & 3 deletions src/_data/datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@ const fetchFromGhost = require('../../utils/ghost/fetch-from-ghost');
const fetchFromHashnode = require('../../utils/hashnode/fetch-from-hashnode');
const { postsPerPage, siteURL } = require('../../config');
const pingEditorialTeam = require('../../utils/ping-editorial-team');
const idleTimeoutMS = 3600000; // 1 hour

const getUniqueList = (arr, key) => [
...new Map(arr.map(item => [item[key], item])).values()
];

const piscinaGhost = new Piscina({
filename: resolve(__dirname, '../../utils/ghost/process-batch')
filename: resolve(__dirname, '../../utils/ghost/process-batch'),
idleTimeout: idleTimeoutMS
});
const piscinaHashnode = new Piscina({
filename: resolve(__dirname, '../../utils/hashnode/process-batch')
filename: resolve(__dirname, '../../utils/hashnode/process-batch'),
idleTimeout: idleTimeoutMS
});

module.exports = async () => {
// Chunk raw Ghost posts and pages and process them in batches
// with a pool of workers to create posts and pages global data
const batchSize = 200;
const batchSize = 300;
const allGhostPosts = await fetchFromGhost('posts');
const allHashnodePosts = await fetchFromHashnode('posts');
const allGhostPages = await fetchFromGhost('pages');
Expand Down
4 changes: 4 additions & 0 deletions utils/ghost/process-batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ const processBatch = async ({
})
);

console.log(
`Finished processing Ghost ${contentType} batch ${currBatchNo} of ${totalBatches}...and using ${process.memoryUsage.rss() / 1024 / 1024} MB of memory`
);

return batch;
};

Expand Down
4 changes: 4 additions & 0 deletions utils/hashnode/process-batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ const processBatch = async ({
})
);

console.log(
`Finished processing Hashnode ${contentType} batch ${currBatchNo} of ${totalBatches}...and using ${process.memoryUsage.rss() / 1024 / 1024} MB of memory`
);

return batch;
};

Expand Down

0 comments on commit 90b134c

Please sign in to comment.