Skip to content

Commit

Permalink
MBS-9327: Fix backlink cache task
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-csg committed Aug 29, 2024
1 parent 45b26e8 commit c252cb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions classes/cachemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public static function build_backlink_cache(int $courseid = 0) {
$coursepageurl = course_get_format($module->course)->get_view_url($module->sectionnum);
$coursepageurl->set_anchor('module-' . $module->id);
foreach ($placestore->places as $place) {
// if (!isset($place->linkedActivity)) {
// continue;
// }
$url = !empty($module->showdescription) ?
$coursepageurl->out() :
new \moodle_url('/mod/learningmap/view.php', ['id' => $module->id]);
Expand Down
2 changes: 1 addition & 1 deletion classes/task/fill_backlink_cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function execute() {
$fillstate = $cache->get('fillstate');

// If the cache is filled within the last 24 hours, do nothing.
if (!empty($fillstate) && $fillstate < time() - 60 * 60 * 24) {
if (!empty($fillstate) && $fillstate > time() - 60 * 60 * 24) {
mtrace('Backlink cache is already filled within the last 24 hours. Exiting.');
return;
}
Expand Down

0 comments on commit c252cb7

Please sign in to comment.