Re: [Django] #35364: AdminEmailHandler wastes work when ADMINS isn’t set

2024-04-12 Thread Django
#35364: AdminEmailHandler wastes work when ADMINS isn’t set
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  closed
Component:  Error reporting  |  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

 * resolution:   => fixed
 * status:  assigned => closed

Comment:

 In [changeset:"50a702f3fd87e271945aa5e88ae8a39d7a2149fd" 50a702f]:
 {{{#!CommitTicketReference repository=""
 revision="50a702f3fd87e271945aa5e88ae8a39d7a2149fd"
 Fixed #35364 -- Stopped AdminEmailHandler rendering email unnecessarily.
 }}}
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ed17470e2-deeaae47-1b3b-4a51-a727-7cc0d8ac4e36-00%40eu-central-1.amazonses.com.


Re: [Django] #35364: AdminEmailHandler wastes work when ADMINS isn’t set

2024-04-12 Thread Django
#35364: AdminEmailHandler wastes work when ADMINS isn’t set
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Error reporting  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

 In [changeset:"b0f2289426d2af0d3f31e50bd8d5e60a49d62710" b0f2289]:
 {{{#!CommitTicketReference repository=""
 revision="b0f2289426d2af0d3f31e50bd8d5e60a49d62710"
 Refs #35364 -- Tested AdminEmailHandler with empty ADMINS.
 }}}
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ed17470a7-fda13f76-da03-48bd-8a40-890b00d6e974-00%40eu-central-1.amazonses.com.


Re: [Django] #35364: AdminEmailHandler wastes work when ADMINS isn’t set

2024-04-10 Thread Django
#35364: AdminEmailHandler wastes work when ADMINS isn’t set
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Error reporting  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Accepted => Ready for checkin

Comment:

 [https://github.com/django/django/pull/18059 PR]
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ec7367ba7-aae19e39-9b38-48da-87f3-b433ee2ed396-00%40eu-central-1.amazonses.com.


Re: [Django] #35364: AdminEmailHandler wastes work when ADMINS isn’t set

2024-04-09 Thread Django
#35364: AdminEmailHandler wastes work when ADMINS isn’t set
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Error reporting  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Adam Johnson):

 * has_patch:  0 => 1

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ec3567083-2c22fe80-0af2-4c15-81df-e93d8cc39398-00%40eu-central-1.amazonses.com.


Re: [Django] #35364: AdminEmailHandler wastes work when ADMINS isn’t set

2024-04-09 Thread Django
#35364: AdminEmailHandler wastes work when ADMINS isn’t set
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Error reporting  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Natalia Bidart):

 * stage:  Unreviewed => Accepted

Comment:

 Makes sense, thank you!
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ec352d6ef-eeb965ed-df84-427e-bb16-eb9a5e952f1c-00%40eu-central-1.amazonses.com.


Re: [Django] #35364: AdminEmailHandler wastes work when ADMINS isn’t set

2024-04-09 Thread Django
#35364: AdminEmailHandler wastes work when ADMINS isn’t set
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Error reporting  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Adam Johnson):

 * owner:  (none) => Adam Johnson
 * status:  new => assigned

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ec314b448-1351b12b-63d5-4ecb-a8a9-0feee9134e32-00%40eu-central-1.amazonses.com.


[Django] #35364: AdminEmailHandler wastes work when ADMINS isn’t set

2024-04-09 Thread Django
#35364: AdminEmailHandler wastes work when ADMINS isn’t set
+
   Reporter:  Adam Johnson  |  Owner:  (none)
   Type:  Cleanup/optimization  | Status:  new
  Component:  Error reporting   |Version:  dev
   Severity:  Normal|   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
  UI/UX:  0 |
+
 `AdminEmailHandler.emit()` does a lot of work to assemble the message it
 passes to `mail_admins`. If `settings.ADMINS` is empty, `mail_admins()`
 returns instantly, wasting all the message-creation work. It’s quite
 common to not configure `ADMINS`, whether in lieu of more advanced tools
 like Sentry, or during tests.

 In a quick benchmark on my M1 Mac Pro on Python 3.11, the overhead is
 ~2.5ms:

 {{{
 In [1]: import logging

 In [2]: logger = logging.getLogger('django')

 In [3]: %timeit logger.error("Yada")
 ...
 2.78 ms ± 75.4 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

 In [4]: logger = logging.getLogger('example')

 In [5]: %timeit logger.error("Yada")
 ...
 8.37 µs ± 38.9 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops
 each)
 }}}

 This can be avoided by adding an initial check to
 `AdminEmailHandler.emit()`.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ec3149aae-5bb7be16-fce4-4747-871f-319944643c4c-00%40eu-central-1.amazonses.com.