mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 03:09:14 +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:
|
with:
|
||||||
node-version: lts/*
|
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 { sources } from "../shared/sources"
|
||||||
import { delay } from "../shared/utils"
|
|
||||||
|
|
||||||
async function main() {
|
Promise.all(Object.keys(sources).map(id =>
|
||||||
for (const id of Object.keys(sources)) {
|
fetch(`https://newsnow.busiyi.world/api/s/${id}?latest`, {
|
||||||
await delay(100)
|
headers: {
|
||||||
fetch(`https://newsnow.busiyi.world/api/s/${id}`)
|
Authorization: `Bearer ${process.env.JWT_TOKEN}`,
|
||||||
}
|
},
|
||||||
}
|
}),
|
||||||
|
)).catch(console.error)
|
||||||
main().catch(console.error)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user