diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index a2427b830..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Build -on: - pull_request: - push: - branches: - - "!main" - - "!canary" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: Build Test - timeout-minutes: 30 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: yarn - - - name: install dependency npm - run: yarn - - - name: build canary env dist file - run: | - yarn build:canary diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1243c3282..b1f238b2d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,7 @@ name: Deploy Release on: push: branches: + - main - release concurrency: diff --git a/scripts/wiki/fetch-wikis.ts b/scripts/wiki/fetch-wikis.ts index f084a4288..c94666de9 100644 --- a/scripts/wiki/fetch-wikis.ts +++ b/scripts/wiki/fetch-wikis.ts @@ -9,20 +9,22 @@ function delay(ms) { } let retryTimes = 0; + export async function fetchWikiList(memo: IWiki[], updated_at = null, limit = 100) { - console.log('--> fetch wikis from:', dayjs(updated_at * 1000).format('YYYY-MM-DD HH:mm:ss')); - const currentURL = `${apiBaseURL}/api/forward/social/wiki/lists?updated_at=${updated_at}&limit=${limit}`; + console.log("--> fetch wikis from:", dayjs(updated_at * 1000).format("YYYY-MM-DD HH:mm:ss")); + const currentPath = `api/forward/social/wiki/lists?updated_at=${updated_at}&limit=${limit}`; + const currentURL = `${apiBaseURL}/currentPath`; try { - console.log('--> fetch url: ', currentURL) + console.log("--> fetch url: ", currentPath); const resp = await axios.get(currentURL); - if(!resp.data){ - if(retryTimes < 3){ + if (!resp.data) { + if (retryTimes < 3) { retryTimes += 1; - console.log(`[warning] found wikis length = 0 now delay 1000ms retry request ${currentURL} times ${retryTimes}`,) - await delay(1000) + console.log(`[warning] found wikis length = 0 now delay 1000ms retry request ${currentPath} times ${retryTimes}`); + await delay(1000); await fetchWikiList(memo, updated_at, limit); } - }else{ + } else { retryTimes = 0; } const { @@ -36,7 +38,7 @@ export async function fetchWikiList(memo: IWiki[], updated_at = null, limit = 10 await fetchWikiList(memo, lastWiki.content_updated_at, limit); } } catch (error) { - console.error(`Failed to fetch ${currentURL} error:`, error); + console.error(`Failed to fetch ${currentPath} error:`, error); } return memo; }