Code

Opened 7 years ago

Closed 7 years ago

#3067 closed defect (fixed)

[patch] Caching of servername in mail.py slows down startup time

Reported by: SmileyChris Owned by: adrian
Component: Core (Mail) Version:
Severity: normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Especially when running the development server! Every time code changes it can take up to a couple of seconds to restart (before the patch in #3007 it was noticeably faster).

I wrote the initial change to cache the dns name, and while that's still a good idea it would be better to do it lazily instead. Patch attached.

Attachments (1)

better_servername_caching.patch (753 bytes) - added by SmileyChris 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by SmileyChris

comment:1 Changed 7 years ago by adrian

  • Component changed from Core framework to django.core.mail

comment:2 Changed 7 years ago by SmileyChris

  • Triage Stage changed from Unreviewed to Ready for checkin

comment:3 Changed 7 years ago by mtredinnick

It's more normal Python practice to use __str__ for "transparent output" classes like this, so that __repr__ can still be used in debugging, etc, to display the real object (the class instance). I've made that change in the patch I've applied to the repository.

comment:4 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [4536]) Fixed #3067 -- Improved caching of machine hostname to increase server restart
times. Thanks SmileyChris.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.