Opened 12 years ago
Last modified 12 years ago
#10535 closed defect
[patch] TRAC DB flooded with useless entries — at Initial Version
Reported by: | Dirk Stöcker | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 0.12.4 |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
My trac database is flooded with lots of useless entries copying the default values. Especially as this is true for anonymous users the database really gets problems due to this. Below is a patch which prevents adding the timeline entries when they equal the defaults. This does not change beaviour of the software, but reduces required space.
The added 'ifs' simply tests if the new values equal the default and prevent storage. If different values are already stored, the default is nevertheless saved.
--- web_ui.py_ 2012-01-20 23:30:00.000000000 +0100 +++ web_ui.py 2012-01-20 23:37:44.000000000 +0100 @@ -200,8 +200,11 @@ data['context'] = rss_context return 'timeline.rss', data, 'application/rss+xml' else: - req.session['timeline.daysback'] = daysback - req.session['timeline.authors'] = authors + if(as_int(req.session.get('timeline.daysback', + self.default_daysback), None) != daysback): + req.session['timeline.daysback'] = daysback + if(req.session.get('timeline.authors', '') != authors): + req.session['timeline.authors'] = authors html_context = Context.from_request(req) html_context.set_hints(wiki_flavor='oneliner', shorten_lines=self.abbreviated_messages)