Edgewall Software

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 Thijs Triemstra)

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  
    200200            data['context'] = rss_context                                                                                                                                                                     
    201201            return 'timeline.rss', data, 'application/rss+xml'                                                                                                                                               
    202202        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                                                                                                                                                     
    205208            html_context = Context.from_request(req)
    206209            html_context.set_hints(wiki_flavor='oneliner',
    207210                                   shorten_lines=self.abbreviated_messages)

Change History (3)

in reply to:  description ; comment:1 by Remy Blank, 12 years ago

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.

in reply to:  1 comment:2 by Dirk Stöcker, 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 Thijs Triemstra, 12 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.