Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqzss committed Sep 27, 2023
1 parent 945547d commit 25f97f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ __pycache__
.venv/

index-v2.json
sourceCodes.txt
sourceCodes.txt
success_repos.txt
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async def main():

# very bad implementation, but it's just a simple script :)

for sourceCode in sourceCodes:
while sourceCode := sourceCodes.pop() if len(sourceCodes) > 0 else None:
if sourceCode in success_repos_text:
logging.info('Skipping %s', sourceCode)
continue
Expand All @@ -101,7 +101,7 @@ async def main():
logging.info('Starting %s', sourceCode)
await asyncio.sleep(0.5)
cors_list.append(cor)
if len(cors_list) >= cors_workers:
if len(cors_list) >= cors_workers or len(sourceCodes) == 0:
await asyncio.gather(*cors_list)

success_repos_text = success_repos.read_text() if success_repos.exists() else ''
Expand Down

0 comments on commit 25f97f6

Please sign in to comment.