Help understanding how enrol_get_my_courses function works

Help understanding how enrol_get_my_courses function works

by Jose Macchi -
Number of replies: 0
Hi ! 
Does anyone know which is the reason to do something like this in this section of code/function ? (Moodle 3.5)

.....
$params['now1'] = round(time(), -2); // Improves db caching.
$params['now2'] = $params['now1'];
}
...

in file moodle/lib/enrollib.php  line 648

When attempting to get list of all the courses on which a user is enrolled.

Why to round that time and then use it in the query (comparing with the user_enrollment timestamp) ?
How that improves db caching ?

The result of that in terms of UX is that right after enrolment, if a user check the list of course (/my) then sometimes the course is not still visible (based on last 2 digits of the round, implying in worst case 100 seconds of delay)

If someone knows, it would be really interesting (just for purpose of documenting that)

Average of ratings: -