When photos are destroyed, there are unnecessary database calls for
each thumbnail.  They request comments, taggings, and activities for
these thumbnails, which do not exist:

  Comment Load (0.2ms)   SELECT * FROM `comments` WHERE
(`comments`.commentable_id = 303 AND `comments`.commentable_type =
'Photo')
    vendor/plugins/community_engine/engine_plugins/paginating_find/lib/
paginating_find.rb:103:in `find'
    vendor/plugins/community_engine/engine_config/initializers/
attachment_fu_fix.rb:25:in `run_callbacks'
    vendor/plugins/community_engine/engine_plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:510:in `destroy_thumbnails'
    vendor/plugins/community_engine/engine_plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:510:in `destroy_thumbnails'
    vendor/plugins/community_engine/engine_config/initializers/
attachment_fu_fix.rb:25:in `run_callbacks'
  Tagging Load (0.2ms)   SELECT * FROM `taggings` WHERE
(`taggings`.taggable_id = 303 AND `taggings`.taggable_type = 'Photo')
    vendor/plugins/community_engine/engine_plugins/paginating_find/lib/
paginating_find.rb:103:in `find'
    vendor/plugins/community_engine/engine_config/initializers/
attachment_fu_fix.rb:25:in `run_callbacks'
    vendor/plugins/community_engine/engine_plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:510:in `destroy_thumbnails'
    vendor/plugins/community_engine/engine_plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:510:in `destroy_thumbnails'
    vendor/plugins/community_engine/engine_config/initializers/
attachment_fu_fix.rb:25:in `run_callbacks'
  Activity Load (0.4ms)   SELECT * FROM `activities` WHERE
(`activities`.item_id = 303 AND `activities`.item_type = 'Photo')
    vendor/plugins/community_engine/engine_plugins/paginating_find/lib/
paginating_find.rb:103:in `find'
    vendor/plugins/community_engine/engine_config/initializers/
attachment_fu_fix.rb:25:in `run_callbacks'
    vendor/plugins/community_engine/engine_plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:510:in `destroy_thumbnails'
    vendor/plugins/community_engine/engine_plugins/attachment_fu/lib/
technoweenie/attachment_fu.rb:510:in `destroy_thumbnails'
    vendor/plugins/community_engine/engine_config/initializers/
attachment_fu_fix.rb:25:in `run_callbacks'

Is there a way to avoid this?

Please note that I'm not working on the latest version.  If there is
already a fix, I would like to know where in the source to look for
it.  Otherwise, I would appreciate some guidance on how to optimize it
and if successful will contribute it back into the CE code base.

-- 
You received this message because you are subscribed to the Google Groups 
"CommunityEngine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/communityengine?hl=en.

Reply via email to