* Add the ability to update profiles via the cache, so that cached profiles don't become stale

* Add corresponding unit test
This commit is contained in:
Justin Clarke Casey
2009-04-21 15:21:27 +00:00
parent f31a60bad7
commit d2d0b9877f
3 changed files with 53 additions and 1 deletions

View File

@@ -168,6 +168,29 @@ namespace OpenSim.Framework.Communications.Cache
}
}
/// <summary>
/// Update an existing profile
/// </summary>
/// <param name="userProfile"></param>
/// <returns>true if a user profile was found to update, false otherwise</returns>
public bool UpdateProfile(UserProfileData userProfile)
{
lock (m_userProfilesById)
{
CachedUserInfo userInfo = GetUserDetails(userProfile.ID);
if (userInfo != null)
{
userInfo.m_userProfile = userProfile;
m_commsManager.UserService.UpdateUserProfile(userProfile);
return true;
}
}
return false;
}
/// <summary>
/// Populate caches with the given user profile
/// </summary>