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

Commit 70dd05d

Browse files
Merge pull request #154 from topcoder-platform/gigs-optimize-b
Gigs optimize part 2
2 parents a3c920c + d2b9a69 commit 70dd05d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Diff for: 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 {

Diff for: 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)