Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/14/2016 02:06:10 AM (9 years ago)
Author:
boonebgorges
Message:

Activity: Invalidate query caches when a user's 'last_activity' is updated.

User 'last_activity' is stored in the activity table, but not updated
via the Activity API, so regular invalidation techniques do not work.

In addition, 'last_activity' is quite frequently updated, meaning that
the activity query cache becomes less valuable. To mitigate this, the
current changeset separates the cache for queries containing
'last_activity' from the cache for those that do not.

Fixes #7245.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-core-user.php

    r11026 r11101  
    913913        wp_cache_set( $user_id, $activity[ $user_id ], 'bp_last_activity' );
    914914
     915        /**
     916         * Fires when a user's last_activity value has been updated.
     917         *
     918         * @since 2.7.0
     919         *
     920         * @param int    $user_id ID of the user.
     921         * @param string $time    Last activity timestamp, in 'Y-m-d H:i:s' format.
     922         */
     923        do_action( 'bp_core_user_updated_last_activity', $user_id, $time );
     924
    915925        return $updated;
    916926    }
Note: See TracChangeset for help on using the changeset viewer.