Show More
@@ -179,10 +179,12 b' class SummaryController(BaseRepoControll' | |||||
179 | if c.enable_downloads: |
|
179 | if c.enable_downloads: | |
180 | c.download_options = self._get_download_links(c.rhodecode_repo) |
|
180 | c.download_options = self._get_download_links(c.rhodecode_repo) | |
181 |
|
181 | |||
182 |
c.readme_data, c.readme_file = self.__get_readme_data( |
|
182 | c.readme_data, c.readme_file = self.__get_readme_data( | |
|
183 | c.rhodecode_db_repo.repo_name, c.rhodecode_repo | |||
|
184 | ) | |||
183 | return render('summary/summary.html') |
|
185 | return render('summary/summary.html') | |
184 |
|
186 | |||
185 | def __get_readme_data(self, repo): |
|
187 | def __get_readme_data(self, repo_name, repo): | |
186 |
|
188 | |||
187 | @cache_region('long_term') |
|
189 | @cache_region('long_term') | |
188 | def _get_readme_from_cache(key): |
|
190 | def _get_readme_from_cache(key): | |
@@ -190,9 +192,10 b' class SummaryController(BaseRepoControll' | |||||
190 | readme_file = None |
|
192 | readme_file = None | |
191 | log.debug('Fetching readme file') |
|
193 | log.debug('Fetching readme file') | |
192 | try: |
|
194 | try: | |
193 | cs = repo.get_changeset() # fetches TIP |
|
195 | cs = repo.get_changeset() # fetches TIP | |
194 | renderer = MarkupRenderer() |
|
196 | renderer = MarkupRenderer() | |
195 | for f in README_FILES: |
|
197 | for f in README_FILES: | |
|
198 | print f | |||
196 | try: |
|
199 | try: | |
197 | readme = cs.get_node(f) |
|
200 | readme = cs.get_node(f) | |
198 | readme_file = f |
|
201 | readme_file = f | |
@@ -202,6 +205,7 b' class SummaryController(BaseRepoControll' | |||||
202 | except NodeDoesNotExistError: |
|
205 | except NodeDoesNotExistError: | |
203 | continue |
|
206 | continue | |
204 | except ChangesetError: |
|
207 | except ChangesetError: | |
|
208 | log.error(traceback.format_exc()) | |||
205 | pass |
|
209 | pass | |
206 | except EmptyRepositoryError: |
|
210 | except EmptyRepositoryError: | |
207 | pass |
|
211 | pass | |
@@ -210,7 +214,7 b' class SummaryController(BaseRepoControll' | |||||
210 |
|
214 | |||
211 | return readme_data, readme_file |
|
215 | return readme_data, readme_file | |
212 |
|
216 | |||
213 |
key = |
|
217 | key = repo_name + '_README' | |
214 | inv = CacheInvalidation.invalidate(key) |
|
218 | inv = CacheInvalidation.invalidate(key) | |
215 | if inv is not None: |
|
219 | if inv is not None: | |
216 | region_invalidate(_get_readme_from_cache, None, key) |
|
220 | region_invalidate(_get_readme_from_cache, None, key) |
General Comments 0
You need to be logged in to leave comments.
Login now