From 46b5bce12610f5f6b5414238da99eb2018edb04f Mon Sep 17 00:00:00 2001 From: Cherik Date: Sun, 13 Oct 2024 19:17:01 +0330 Subject: [PATCH 1/5] update address --- src/features/import-projects/rf/index.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/features/import-projects/rf/index.ts b/src/features/import-projects/rf/index.ts index 8ea6496..53ddad1 100644 --- a/src/features/import-projects/rf/index.ts +++ b/src/features/import-projects/rf/index.ts @@ -19,16 +19,14 @@ export const fetchRFProjectsByRound = async (round: number) => { try { while (hasNext) { - const response = await fetch( - `${RF_API_URL}/retrofunding/rounds/${round}/projects?limit=${limit}&offset=${offset}`, - { - method: "GET", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${AGORA_API_KEY}`, - }, - } - ); + const address = `${RF_API_URL}/retrofunding/rounds/${round}/projects?limit=${limit}&offset=${offset}`; + const response = await fetch(address, { + method: "GET", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${AGORA_API_KEY}`, + }, + }); console.log( `[${new Date().toISOString()}] - Fetching projects for round: ${round} at offset: ${offset} - ${response.status} - ${response.ok}` ); From fa0ec1e42643007ccbb9634a356be946a00f6e5b Mon Sep 17 00:00:00 2001 From: Cherik Date: Sun, 13 Oct 2024 19:25:59 +0330 Subject: [PATCH 2/5] modify logs --- src/features/import-projects/retroList/helper.ts | 3 --- src/features/import-projects/rf/index.ts | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/features/import-projects/retroList/helper.ts b/src/features/import-projects/retroList/helper.ts index c247cb1..3b37fec 100644 --- a/src/features/import-projects/retroList/helper.ts +++ b/src/features/import-projects/retroList/helper.ts @@ -30,7 +30,6 @@ export const manageProjectRemovals = async ( const shouldKeepProjects = newList .filter((project) => project.prelimResult === "Keep") .map((project) => `${sourceConfig.source}-${project.id}`); - console.log("shouldKeepProjects", shouldKeepProjects); const existingProjectsIds = await dataSource .getRepository(Project) @@ -41,8 +40,6 @@ export const manageProjectRemovals = async ( .getMany() .then((projects) => projects.map((proj) => proj.id)); - console.log("existingProjectsIds", existingProjectsIds); - const projectIdsToManipulate = existingProjectsIds.filter( (id) => !shouldKeepProjects.includes(id) ); diff --git a/src/features/import-projects/rf/index.ts b/src/features/import-projects/rf/index.ts index 53ddad1..fe9f0af 100644 --- a/src/features/import-projects/rf/index.ts +++ b/src/features/import-projects/rf/index.ts @@ -45,7 +45,7 @@ export const fetchRFProjectsByRound = async (round: number) => { offset = res.meta.next_offset; } } catch (error) { - console.error( + console.log( `Error fetching projects for round: ${round} at offset: ${offset}`, error ); From 7d5d87b2a31a53f287949aedc93762671c1038a7 Mon Sep 17 00:00:00 2001 From: Cherik Date: Sun, 13 Oct 2024 19:30:59 +0330 Subject: [PATCH 3/5] change error to log --- src/features/import-projects/rf/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/import-projects/rf/index.ts b/src/features/import-projects/rf/index.ts index fe9f0af..b0117c4 100644 --- a/src/features/import-projects/rf/index.ts +++ b/src/features/import-projects/rf/index.ts @@ -13,7 +13,7 @@ export const fetchRFProjectsByRound = async (round: number) => { ); if (!AGORA_API_KEY) { - console.error("AGORA_API_KEY is not set"); + console.log("AGORA_API_KEY is not set"); return; } From 321f144f5ee427e1643f8c5cf4cc00a2c5438641 Mon Sep 17 00:00:00 2001 From: Cherik Date: Sun, 13 Oct 2024 19:37:21 +0330 Subject: [PATCH 4/5] add time to log --- src/features/import-projects/rf/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/import-projects/rf/index.ts b/src/features/import-projects/rf/index.ts index b0117c4..221e30c 100644 --- a/src/features/import-projects/rf/index.ts +++ b/src/features/import-projects/rf/index.ts @@ -46,7 +46,7 @@ export const fetchRFProjectsByRound = async (round: number) => { } } catch (error) { console.log( - `Error fetching projects for round: ${round} at offset: ${offset}`, + `[${new Date().toISOString()}] - Error fetching projects for round: ${round} at offset: ${offset}`, error ); } From 25fb844af61c306575577784f0c7fe26e7e12563 Mon Sep 17 00:00:00 2001 From: Cherik Date: Sun, 13 Oct 2024 19:50:05 +0330 Subject: [PATCH 5/5] add time to agora api log --- src/features/import-projects/rf/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/import-projects/rf/index.ts b/src/features/import-projects/rf/index.ts index 221e30c..1c5e9fb 100644 --- a/src/features/import-projects/rf/index.ts +++ b/src/features/import-projects/rf/index.ts @@ -13,7 +13,7 @@ export const fetchRFProjectsByRound = async (round: number) => { ); if (!AGORA_API_KEY) { - console.log("AGORA_API_KEY is not set"); + console.log(`[${new Date().toISOString()}] - AGORA_API_KEY is not set`); return; }