Clear memcache when someone joins or leaves the community, in order to
update which entries we see when we go to a community's read page (the member
list on the profile worked even before this). Also propagate upwards the
success/failure return value, just because.
Patch by kareila.
diffs (28 lines):
diff -r 92e48ffb8d08 -r f6bcfe133fe2 cgi-bin/DW/User/Edges/CommMembership.pm
--- a/cgi-bin/DW/User/Edges/CommMembership.pm Fri Jun 11 17:27:47 2010 +0800
+++ b/cgi-bin/DW/User/Edges/CommMembership.pm Fri Jun 11 17:48:52 2010 +0800
@@ -47,7 +47,13 @@ sub _add_m_edge {
return 0 unless $from_u->can_join( $to_u, moderated_add =>
$member_edge->{moderated_add} ? 1 : 0 );
# simply add the reluser edge
- LJ::set_rel( $to_u, $from_u, 'E' );
+ my $rv = LJ::set_rel( $to_u, $from_u, 'E' );
+
+ # delete memcache key for community reading pages
+ LJ::memcache_kill( $to_u, 'c_wt_list' );
+
+ # success?
+ return $rv;
}
# internal method to delete an edge
@@ -63,6 +69,9 @@ sub _del_m_edge {
# now remove it; note we don't do any extraneous checking. if the user
# wants to remove an edge that doesn't exist? more power to them.
LJ::clear_rel( $to_u, $from_u, 'E' );
+
+ # delete memcache key for community reading pages
+ LJ::memcache_kill( $to_u, 'c_wt_list' );
# success!
return 1;
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog