Skip to content

Commit dac97ff

Browse files
committed
Suppress warnings for wiki link revalidate
1 parent 5f2c871 commit dac97ff

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/services/revalidate.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from 'axios'
2+
import fs from 'fs'
23
import { singleton } from 'tsyringe'
34
import { writeFile } from '../utils/helpers.js'
45

@@ -50,6 +51,11 @@ export default class RevalidateService {
5051
}
5152

5253
async revalidateRandomWiki(url: string, path: string) {
54+
if (!fs.existsSync(path)) {
55+
console.log(`⚠️ Wiki links file not found: ${path}, skipping revalidation`)
56+
return
57+
}
58+
5359
const { links } = await import(path)
5460

5561
if (links.length !== 0) {

0 commit comments

Comments
 (0)