Skip to content

Commit

Permalink
MDL-83185: Add invalidation event
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentdavid committed Oct 30, 2024
1 parent 37de519 commit 70cfa3f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions course/format/classes/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ public static function session_cache_reset_all(): void {
*/
public static function session_cache_reset(stdClass $course): string {
$statecache = cache::make('core', 'courseeditorstate');
\cache_helper::invalidate_by_event('changesincoursestate', [$course->id]);
$newkey = $course->cacherev . '_' . time();
$statecache->set($course->id, $newkey);
return $newkey;
Expand Down
3 changes: 3 additions & 0 deletions lib/db/caches.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@
'mode' => cache_store::MODE_SESSION,
'simplekeys' => true,
'simpledata' => true,
'invalidationevents' => [
'changesincoursestate',
],
],
// Course actions instances cache.
'courseactionsinstances' => [
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

defined('MOODLE_INTERNAL') || die();

$version = 2024102500.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2024102500.02; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '5.0dev (Build: 20241025)'; // Human-friendly version name
Expand Down

0 comments on commit 70cfa3f

Please sign in to comment.