Opened 12 years ago
Last modified 12 years ago
#10535 closed defect
[patch] TRAC DB flooded with useless entries — at Version 3
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 (last modified by )
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.
old new 200 200 data['context'] = rss_context 201 201 return 'timeline.rss', data, 'application/rss+xml' 202 202 else: 203 req.session['timeline.daysback'] = daysback 204 req.session['timeline.authors'] = authors 203 if(as_int(req.session.get('timeline.daysback', 204 self.default_daysback), None) != daysback): 205 req.session['timeline.daysback'] = daysback 206 if(req.session.get('timeline.authors', '') != authors): 207 req.session['timeline.authors'] = authors 205 208 html_context = Context.from_request(req) 206 209 html_context.set_hints(wiki_flavor='oneliner', 207 210 shorten_lines=self.abbreviated_messages)
Change History (3)
follow-up: 2 comment:1 by , 12 years ago
comment:2 by , 12 years ago
Replying to rblank:
Replying to dstoecker:
This does not change beaviour of the software, but reduces required space.
That's not quite 100% true. It will change the behavior if the default values are changed in Trac at some point. This could actually be considered a feature.
True. Actually I would consider it a feature.
comment:3 by , 12 years ago
Description: | modified (diff) |
---|
Replying to dstoecker:
That's not quite 100% true. It will change the behavior if the default values are changed in Trac at some point. This could actually be considered a feature.