mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-18 18:59:15 +08:00
chore: update workflow action
This commit is contained in:
parent
cacf33a1e4
commit
8ffd77b2eb
5
.github/workflows/auto-refresh.yml
vendored
5
.github/workflows/auto-refresh.yml
vendored
@ -17,4 +17,7 @@ jobs:
|
||||
with:
|
||||
node-version: lts/*
|
||||
|
||||
- run: npx tsx ./scripts/refresh.ts
|
||||
- name: Refresh
|
||||
env:
|
||||
JWT_TOKEN: ${{ secrets.JWT_TOKEN }}
|
||||
run: npx tsx ./scripts/refresh.ts
|
||||
|
@ -1,11 +1,10 @@
|
||||
import process from "node:process"
|
||||
import { sources } from "../shared/sources"
|
||||
import { delay } from "../shared/utils"
|
||||
|
||||
async function main() {
|
||||
for (const id of Object.keys(sources)) {
|
||||
await delay(100)
|
||||
fetch(`https://newsnow.busiyi.world/api/s/${id}`)
|
||||
}
|
||||
}
|
||||
|
||||
main().catch(console.error)
|
||||
Promise.all(Object.keys(sources).map(id =>
|
||||
fetch(`https://newsnow.busiyi.world/api/s/${id}?latest`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${process.env.JWT_TOKEN}`,
|
||||
},
|
||||
}),
|
||||
)).catch(console.error)
|
||||
|
Loading…
x
Reference in New Issue
Block a user