Closed (fixed)
Project:
User Relationships
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
30 Oct 2007 at 22:51 UTC
Updated:
13 Nov 2007 at 22:52 UTC
I committed a couple of changes to user_relationships_api.inc:
user_relationships_update_relationship() function was doing a db DELETE/INSERT, instead of a db UDPATE to update relationships. This meant the rid of a relationship changed every time the relationship was updated. This could cause a problem for other modules that use the rid to identify relationships. The function now does an UPDATE and preserves the rid.
user_relationships_load_all_for_user() function was blindly caching the results of every query it did, regardless of size. When memcached is installed and you loaded all relationships for certain users, e.g. the default 'buddy' on your site, this could result in blowing out memory on a single cache_set(). I added a $cache_throttle PHP variable to control the maximum number of relationships it will try to cache. I set the PHP variable by doing a variable_get('user_relationships_cache_throttle', 5000) in anticipation of someday making the throttle an admin-configurable setting. However, nothing currently sets that drupal variable, so for now it's effectively hardcoded to cache a maximum of 5,000 relationships.
Comments
Comment #1
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.