Skip to content

Commit

Permalink
fix sync
Browse files Browse the repository at this point in the history
  • Loading branch information
ady-beraud committed May 16, 2024
1 parent f97d3c2 commit 375518b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { graphql } from '@octokit/graphql';

import { getLatestUpdate } from '@/github-sync/contributors/get-latest-update';
import { getLatestUpdate } from '@/github/contributors/get-latest-update';
import {
IssueNode,
PullRequestNode,
Expand Down Expand Up @@ -82,6 +82,7 @@ export async function searchIssuesPRs(
cursor,
},
);

const newAccumulatedData: Array<PullRequestNode | IssueNode> = [
...accumulatedData,
...search.edges.map(({ node }) => node),
Expand Down
1 change: 0 additions & 1 deletion packages/twenty-website/src/github/execute-partial-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const executePartialSync = async () => {
await fetchAndSaveGithubReleases(query);

const assignableUsers = await fetchAssignableUsers(query);
console.log(assignableUsers);

const fetchedPRs = (await searchIssuesPRs(
query,
Expand Down
12 changes: 7 additions & 5 deletions packages/twenty-website/src/github/github-sync.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { executePartialSync } from '@/github/execute-partial-sync';
import { fetchAndSaveGithubData } from '@/github/fetch-and-save-github-data';

export const githubSync = async () => {
const pageLimitFlagIndex = process.argv.indexOf('--pageLimit');
let pageLimit = 0;
const isFullSyncFlagIndex = process.argv.indexOf('--isFullSync');
const isFullSync = isFullSyncFlagIndex > -1;

if (pageLimitFlagIndex > -1) {
pageLimit = parseInt(process.argv[pageLimitFlagIndex + 1], 10);
if (isFullSync) {
await fetchAndSaveGithubData();
} else {
await executePartialSync();
}

await fetchAndSaveGithubData({ pageLimit });
process.exit(0);
};

Expand Down

0 comments on commit 375518b

Please sign in to comment.