Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadPCh committed Oct 13, 2024
2 parents c154f3a + 25fb844 commit 43c7852
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
3 changes: 0 additions & 3 deletions src/features/import-projects/retroList/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
);
Expand Down
24 changes: 11 additions & 13 deletions src/features/import-projects/rf/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,20 @@ export const fetchRFProjectsByRound = async (round: number) => {
);

if (!AGORA_API_KEY) {
console.error("AGORA_API_KEY is not set");
console.log(`[${new Date().toISOString()}] - AGORA_API_KEY is not set`);
return;
}

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}`
);
Expand All @@ -47,8 +45,8 @@ export const fetchRFProjectsByRound = async (round: number) => {
offset = res.meta.next_offset;
}
} catch (error) {
console.error(
`Error fetching projects for round: ${round} at offset: ${offset}`,
console.log(
`[${new Date().toISOString()}] - Error fetching projects for round: ${round} at offset: ${offset}`,
error
);
}
Expand Down

0 comments on commit 43c7852

Please sign in to comment.