Skip to content

Commit

Permalink
Merge pull request #108 from mebis-lp/MBS-9327-Fix-backlink-cache-task
Browse files Browse the repository at this point in the history
MBS-9327: Fix backlink cache task
  • Loading branch information
PhMemmel authored Aug 30, 2024
2 parents 45b26e8 + 8b64f97 commit eaad75b
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 eaad75b

Please sign in to comment.