Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 02a2405

Browse files
author
dengjun
committed
ci:add delaying in check API
1 parent 925a300 commit 02a2405

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ workflows:
7676
filters:
7777
branches:
7878
only:
79-
- dev
79+
- gigs-optimize-b
8080

8181
# Production builds are exectuted only on tagged commits to the
8282
# master branch.

src/actions/myGigs.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { createActions } from "redux-actions";
2-
import { PER_PAGE, CHECKING_GIG_TIMES } from "../constants";
2+
import {
3+
PER_PAGE,
4+
CHECKING_GIG_TIMES,
5+
DELAY_CHECK_GIG_TIME,
6+
} from "../constants";
37
import service from "../services/myGigs";
48

59
/**
@@ -35,6 +39,11 @@ async function startCheckingGigs(externalId) {
3539
while (i < CHECKING_GIG_TIMES) {
3640
const res = await service.startCheckingGigs(externalId);
3741
if (res && !res.synced) {
42+
await new Promise((resolve) => {
43+
setTimeout(() => {
44+
resolve();
45+
}, DELAY_CHECK_GIG_TIME);
46+
});
3847
i++;
3948
continue;
4049
} else {

src/constants/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -354,3 +354,5 @@ export const EMPTY_GIGS_TEXT =
354354
"LOOKS LIKE YOU HAVEN'T APPLIED TO ANY GIG OPPORTUNITIES YET.";
355355

356356
export const CHECKING_GIG_TIMES = 3;
357+
358+
export const DELAY_CHECK_GIG_TIME = 2000;

0 commit comments

Comments
 (0)