#28055: Staticfiles HashedFilesMixin postprocess optimization
-------------------------------------+-------------------------------------
     Reporter:  Konrad LisiczyƄski   |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  contrib.staticfiles  |                  Version:  1.11
     Severity:  Normal               |               Resolution:
     Keywords:  staticfiles          |             Triage Stage:  Accepted
  HashedFilesMixin post_process      |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by David Sanders):

 There definitely appears to be a duplicate delete and save around
 
[https://github.com/django/django/blob/master/django/contrib/staticfiles/storage.py#L304
 line 304], I'm not sure how that slipped through code review. Must have
 been introduced during some refactoring of the code.

 It should be possible to clean up that section and trim the extra
 delete/save. Might be possible to also drop a save if the hash hasn't
 changed as well since the hash can be calculated from the ContentFile
 without saving it to disk. Since the tests now expect the correct hashes
 (and have a few more cases) as long as tests pass it should be fairly
 safe. I don't have the time to look at it deeply, however.

--
Ticket URL: <https://code.djangoproject.com/ticket/28055#comment:4>
Django <https://code.djangoproject.com/>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.2eac75dd0db55138e0d7a7b5fa7c3fd0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to