##// END OF EJS Templates
drastic speed improvment in feed generation (was using old method)
marcink -
r507:f420e86d default
parent child Browse files
Show More
@@ -24,7 +24,7 b' feed controller for pylons'
24 """
24 """
25 from pylons import tmpl_context as c, url, response
25 from pylons import tmpl_context as c, url, response
26 from pylons_app.lib.base import BaseController, render
26 from pylons_app.lib.base import BaseController, render
27 from pylons_app.model.hg_model import _full_changelog_cached
27 from pylons_app.model.hg_model import HgModel
28 from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed
28 from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed
29 import logging
29 import logging
30 log = logging.getLogger(__name__)
30 log = logging.getLogger(__name__)
@@ -49,10 +49,9 b' class FeedController(BaseController):'
49 language=self.language,
49 language=self.language,
50 ttl=self.ttl)
50 ttl=self.ttl)
51
51
52
52 changesets = HgModel().get_repo(repo_name)
53 for cnt, cs in enumerate(_full_changelog_cached(repo_name)):
53
54 if cnt > self.feed_nr:
54 for cs in changesets[:self.feed_nr]:
55 break
56 feed.add_item(title=cs.message,
55 feed.add_item(title=cs.message,
57 link=url('changeset_home', repo_name=repo_name,
56 link=url('changeset_home', repo_name=repo_name,
58 revision=cs.raw_id, qualified=True),
57 revision=cs.raw_id, qualified=True),
@@ -70,11 +69,11 b' class FeedController(BaseController):'
70 language=self.language,
69 language=self.language,
71 ttl=self.ttl)
70 ttl=self.ttl)
72
71
73 for cnt, cs in enumerate(_full_changelog_cached(repo_name)):
72 changesets = HgModel().get_repo(repo_name)
74 if cnt > self.feed_nr:
73 for cs in changesets[:self.feed_nr]:
75 break
76 feed.add_item(title=cs.message,
74 feed.add_item(title=cs.message,
77 link=url('changeset_home', repo_name=repo_name, revision=cs.raw_id, qualified=True),
75 link=url('changeset_home', repo_name=repo_name,
76 revision=cs.raw_id, qualified=True),
78 description=str(cs.date))
77 description=str(cs.date))
79
78
80 response.content_type = feed.mime_type
79 response.content_type = feed.mime_type
General Comments 0
You need to be logged in to leave comments. Login now