api: Regenerate caches even if a repo-update fails

This commit is contained in:
Fatih Aşıcı
2010-11-03 12:35:30 +00:00
parent a6eb4a6765
commit fd6c0f77a9
+2
View File
@@ -816,8 +816,10 @@ def remove_repo(name):
def update_repos(repos, force=False): def update_repos(repos, force=False):
pisi.db.historydb.HistoryDB().create_history("repoupdate") pisi.db.historydb.HistoryDB().create_history("repoupdate")
updated = False updated = False
try:
for repo in repos: for repo in repos:
updated |= __update_repo(repo, force) updated |= __update_repo(repo, force)
finally:
if updated: if updated:
pisi.db.regenerate_caches() pisi.db.regenerate_caches()