MDL-63466 core_message: rename cache for last message time

This commit is contained in:
Mark Nelson 2018-10-10 17:12:24 +08:00 committed by Jake Dallimore
parent fb04293bb1
commit f978593d6c
5 changed files with 8 additions and 8 deletions

View File

@ -55,7 +55,7 @@ $string['cachedef_suspended_userids'] = 'List of suspended users per course';
$string['cachedef_groupdata'] = 'Course group information';
$string['cachedef_htmlpurifier'] = 'HTML Purifier - cleaned content';
$string['cachedef_langmenu'] = 'List of available languages';
$string['cachedef_message_time_last_message_between_users'] = 'Time created for most recent message in a conversation';
$string['cachedef_message_time_last_message_in_conversation'] = 'Time created for most recent message in a conversation';
$string['cachedef_locking'] = 'Locking';
$string['cachedef_message_processors_enabled'] = "Message processors enabled status";
$string['cachedef_contextwithinsights'] = 'Context with insights';

View File

@ -343,11 +343,11 @@ $definitions = array(
),
// Caches the time of the last message in a conversation.
'message_time_last_message_between_users' => array(
'message_time_last_message_in_conversation' => array(
'mode' => cache_store::MODE_APPLICATION,
'simplekeys' => true, // The conversation id is used.
'simplevalues' => true,
'datasource' => '\core_message\time_last_message_between_users',
'datasource' => '\core_message\time_last_message_in_conversation',
),
// Caches font awesome icons.

View File

@ -294,7 +294,7 @@ function message_send(\core\message\message $eventdata) {
if (!$eventdata->notification) {
if (!empty($eventdata->convid)) {
// Cache the timecreated value of the last message in this conversation.
$cache = cache::make('core', 'message_time_last_message_between_users');
$cache = cache::make('core', 'message_time_last_message_in_conversation');
$key = \core_message\helper::get_last_message_time_created_cache_key($eventdata->convid);
$cache->set($key, $tabledata->timecreated);
}

View File

@ -654,7 +654,7 @@ class api {
if (!empty($timefrom)) {
// Check the cache to see if we even need to do a DB query.
$cache = \cache::make('core', 'message_time_last_message_between_users');
$cache = \cache::make('core', 'message_time_last_message_in_conversation');
$key = helper::get_last_message_time_created_cache_key($convid);
$lastcreated = $cache->get($key);

View File

@ -35,9 +35,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2016 Ryan Wyllie <ryan@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class time_last_message_between_users implements \cache_data_source {
class time_last_message_in_conversation implements \cache_data_source {
/** @var time_last_message_between_users the singleton instance of this class. */
/** @var time_last_message_in_conversation the singleton instance of this class. */
protected static $instance = null;
/**
@ -49,7 +49,7 @@ class time_last_message_between_users implements \cache_data_source {
*/
public static function get_instance_for_cache(\cache_definition $definition) {
if (is_null(self::$instance)) {
self::$instance = new time_last_message_between_users();
self::$instance = new time_last_message_in_conversation();
}
return self::$instance;
}