Skip to content

Commit 229d0ce

Browse files
committed
Avoid querying a duplicated result (resolve #59)
1 parent 86d555a commit 229d0ce

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

website/src/queries-logic.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,14 @@ function update_table_trying_use_filter() {
194194
}
195195
}
196196

197+
function is_duplicate_repo(name) {
198+
for (const fork of TABLE_DATA) {
199+
if (fork['name'] === name)
200+
return true;
201+
}
202+
return false;
203+
}
204+
197205
/** Updates table data, then calls function to update the table. */
198206
function update_table_data(responseData, user, repo, parentDefaultBranch) {
199207
if (isEmpty(responseData)) {
@@ -209,6 +217,9 @@ function update_table_data(responseData, user, repo, parentDefaultBranch) {
209217
if (RATE_LIMIT_EXCEEDED) // we can skip everything below because they are only requests
210218
continue;
211219

220+
if (is_duplicate_repo(currFork.full_name))
221+
continue; // abort because repo is already listed
222+
212223
let datum = {
213224
'name': currFork.full_name,
214225
'stars': currFork.stargazers_count,

0 commit comments

Comments
 (0)