Skip to content

Commit a90a3c1

Browse files
committed
Use NO_UPDATE_TIME env variable to not fetch update_time every build
1 parent be49acd commit a90a3c1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

eleventy.config.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,12 @@ export default async function (eleventyConfig) {
327327
let gitCSVFileData = await getGithubData(`https://github.com/ScanGov/data/raw/refs/heads/main/domains.csv`);
328328
fs.writeFileSync(`./public/data/domains.csv`, gitCSVFileData, 'utf8');
329329
}
330-
let gitUpdateTime = await getGithubData('https://github.com/ScanGov/data/raw/refs/heads/main/updated_time');
331-
const currentUpdateTime = fs.readFileSync('./public/data/updated_time', 'utf8');
332-
if (currentUpdateTime !== gitUpdateTime) {
333-
fs.writeFileSync('./public/data/updated_time', gitUpdateTime, 'utf8');
330+
if (!process.env.NO_UPDATE_TIME) {
331+
let gitUpdateTime = await getGithubData('https://github.com/ScanGov/data/raw/refs/heads/main/updated_time');
332+
const currentUpdateTime = fs.readFileSync('./public/data/updated_time', 'utf8');
333+
if (currentUpdateTime !== gitUpdateTime) {
334+
fs.writeFileSync('./public/data/updated_time', gitUpdateTime, 'utf8');
335+
}
334336
}
335337
let domainDataFilled = domainData();
336338
const olddata = JSON.parse(fs.readFileSync('./scripts/data/lastscan.json'));

0 commit comments

Comments
 (0)