Skip to content

Commit

Permalink
404 http code is not decreasing the worth value, closes #211
Browse files Browse the repository at this point in the history
  • Loading branch information
kkamkou committed Sep 29, 2017
1 parent 8cbadcf commit ff94589
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gitmostwanted/tasks/repo_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ def metadata_refresh(num_days):
.yield_per(25)\
.limit(300) # GitHub allows only 3000 calls per day within a token
for repo in repos:
repo.checked_at = datetime.now()

details, code = api.repo_info(repo.full_name)
if not details:
if 400 <= code < 500:
repo.worth -= 1
db.session.commit()
log.info(
'{0} is not found, the "worth" has been decreased by 1'.format(repo.full_name)
'{0} is not found, the "worth" has been decreased by 1'
.format(repo.full_name)
)
continue

repo.checked_at = datetime.now()

for key in [
'description', 'forks_count', 'homepage', 'language', 'open_issues_count', 'size',
'stargazers_count', 'subscribers_count'
Expand Down

0 comments on commit ff94589

Please sign in to comment.