Show More
@@ -68,12 +68,21 b' class Command(BasePasterCommand):' | |||||
68 | repo_list = Repository.getAll() |
|
68 | repo_list = Repository.getAll() | |
69 | RepoModel.update_repoinfo(repositories=repo_list) |
|
69 | RepoModel.update_repoinfo(repositories=repo_list) | |
70 | Session().commit() |
|
70 | Session().commit() | |
|
71 | ||||
|
72 | if self.options.invalidate_cache: | |||
|
73 | for r in repo_list: | |||
|
74 | r.invalidate | |||
|
75 | Session().commit() | |||
71 | log.info('Updated cache for %s repositories' % (len(repo_list))) |
|
76 | log.info('Updated cache for %s repositories' % (len(repo_list))) | |
72 |
|
77 | |||
73 | def update_parser(self): |
|
78 | def update_parser(self): | |
74 | self.parser.add_option('--update-only', |
|
79 | self.parser.add_option('--update-only', | |
75 | action='store', |
|
80 | action='store', | |
76 | dest='repo_update_list', |
|
81 | dest='repo_update_list', | |
77 | help="Specifies a comma separated list of repositores " |
|
82 | help="Specifies a comma separated list of repositores " | |
78 |
"to update last commit info for. OPTIONAL" |
|
83 | "to update last commit info for. OPTIONAL") | |
79 | ) |
|
84 | self.parser.add_option('--invalidate-cache', | |
|
85 | action='store_true', | |||
|
86 | dest='invalidate_cache', | |||
|
87 | help="Trigger cache invalidation event for repos. " | |||
|
88 | "OPTIONAL") |
General Comments 0
You need to be logged in to leave comments.
Login now