From 0203761e5c45a6bedfe66a112b1f978721b462fd Mon Sep 17 00:00:00 2001 From: Lucian Date: Fri, 7 Jul 2023 14:46:32 -0700 Subject: [PATCH] 1400 rescoring (#1443) * feat(app): added BULK_PROCESSING score status * feat(devops): added yarn debug command to start iam with debugger listening --- app/context/scorerContext.tsx | 4 ++-- iam/package.json | 1 + package.json | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/context/scorerContext.tsx b/app/context/scorerContext.tsx index 76bd575a82..484395d157 100644 --- a/app/context/scorerContext.tsx +++ b/app/context/scorerContext.tsx @@ -13,7 +13,7 @@ export type PassportSubmissionStateType = | "APP_REQUEST_PENDING" | "APP_REQUEST_ERROR" | "APP_REQUEST_SUCCESS"; -export type ScoreStateType = "APP_INITIAL" | "PROCESSING" | "ERROR" | "DONE"; +export type ScoreStateType = "APP_INITIAL" | "BULK_PROCESSING" | "PROCESSING" | "ERROR" | "DONE"; export interface ScorerContextState { score: number; @@ -98,7 +98,7 @@ export const ScorerContextProvider = ({ children }: { children: any }) => { let requestCount = 1; let scoreStatus = await loadScore(address, dbAccessToken); - while (scoreStatus === "PROCESSING" && requestCount < maxRequests) { + while ((scoreStatus === "PROCESSING" || scoreStatus === "BULK_PROCESSING") && requestCount < maxRequests) { requestCount++; await new Promise((resolve) => setTimeout(resolve, sleepTime)); if (sleepTime < 10000) { diff --git a/iam/package.json b/iam/package.json index aea8f8810b..e3e0e83e94 100644 --- a/iam/package.json +++ b/iam/package.json @@ -11,6 +11,7 @@ "build": "tsc", "prestart": "yarn run build", "start": "node .", + "debug": "node --inspect .", "prod:start": "tsc && node .", "test": "jest --verbose", "prettier": "prettier --write .", diff --git a/package.json b/package.json index d1a719b2f1..52d258f0ff 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,8 @@ "build:iam": "yarn workspace @gitcoin/passport-iam build", "build:app": "yarn workspace @gitcoin/passport-app build", "build:platforms": "yarn workspace @gitcoin/passport-platforms build", + "debug": "concurrently --kill-others \"yarn debug:iam\" \"yarn start:app\" \"yarn start:signer\"", + "debug:iam": "yarn workspace @gitcoin/passport-iam debug", "start": "concurrently --kill-others \"yarn start:iam\" \"yarn start:app\" \"yarn start:signer\"", "start:iam": "yarn workspace @gitcoin/passport-iam start", "start:signer": "yarn workspace @gitcoin/passport-signer start",