From 02a240518a93029aa728af7d134e4dabb6d41da3 Mon Sep 17 00:00:00 2001 From: dengjun Date: Wed, 7 Jul 2021 13:39:23 +0800 Subject: [PATCH 1/2] ci:add delaying in check API --- .circleci/config.yml | 2 +- src/actions/myGigs.js | 11 ++++++++++- src/constants/index.js | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0cb6119..ad73197 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,7 +76,7 @@ workflows: filters: branches: only: - - dev + - gigs-optimize-b # Production builds are exectuted only on tagged commits to the # master branch. diff --git a/src/actions/myGigs.js b/src/actions/myGigs.js index f992aef..03aaab4 100644 --- a/src/actions/myGigs.js +++ b/src/actions/myGigs.js @@ -1,5 +1,9 @@ import { createActions } from "redux-actions"; -import { PER_PAGE, CHECKING_GIG_TIMES } from "../constants"; +import { + PER_PAGE, + CHECKING_GIG_TIMES, + DELAY_CHECK_GIG_TIME, +} from "../constants"; import service from "../services/myGigs"; /** @@ -35,6 +39,11 @@ async function startCheckingGigs(externalId) { while (i < CHECKING_GIG_TIMES) { const res = await service.startCheckingGigs(externalId); if (res && !res.synced) { + await new Promise((resolve) => { + setTimeout(() => { + resolve(); + }, DELAY_CHECK_GIG_TIME); + }); i++; continue; } else { diff --git a/src/constants/index.js b/src/constants/index.js index cdaed29..a250274 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -354,3 +354,5 @@ export const EMPTY_GIGS_TEXT = "LOOKS LIKE YOU HAVEN'T APPLIED TO ANY GIG OPPORTUNITIES YET."; export const CHECKING_GIG_TIMES = 3; + +export const DELAY_CHECK_GIG_TIME = 2000; From d2b9a69b47baff3411f4f11dbfffe3bab6f4413e Mon Sep 17 00:00:00 2001 From: dengjun Date: Wed, 7 Jul 2021 17:49:07 +0800 Subject: [PATCH 2/2] revert ci --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ad73197..0cb6119 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,7 +76,7 @@ workflows: filters: branches: only: - - gigs-optimize-b + - dev # Production builds are exectuted only on tagged commits to the # master branch.