moodle course filtering logs

This commit is contained in:
anhefti 2020-12-15 19:55:44 +01:00
parent bd6cf929be
commit 85a784b3c0

View file

@ -303,9 +303,13 @@ public class MoodleCourseAccess extends CourseAccess {
final long now = DateTime.now(DateTimeZone.UTC).getMillis() / 1000; final long now = DateTime.now(DateTimeZone.UTC).getMillis() / 1000;
return course -> { return course -> {
if (course.end_date != null && course.end_date > now) { if (course.end_date != null && course.end_date > now) {
log.info("(end)removed course: {} start {} end {}, from {}", course.short_name, course.start_date,
course.end_date, from);
return false; return false;
} }
if (course.time_created != null && course.time_created.longValue() < from) { if (course.time_created != null && course.time_created.longValue() < from) {
log.info("(start)removed course: {} start {} end {}, from {}", course.short_name, course.start_date,
course.end_date, from);
return false; return false;
} }
@ -340,9 +344,6 @@ public class MoodleCourseAccess extends CourseAccess {
return Collections.emptyList(); return Collections.emptyList();
} }
log.info("Got course page with: {} items", keysPage.courseKeys.size());
log.info("course items:\n{} items", keysPage.courseKeys);
// get courses // get courses
final Set<String> ids = keysPage.courseKeys final Set<String> ids = keysPage.courseKeys
.stream() .stream()
@ -354,7 +355,7 @@ public class MoodleCourseAccess extends CourseAccess {
.filter(getCourseFilter(startDate)) .filter(getCourseFilter(startDate))
.collect(Collectors.toList()); .collect(Collectors.toList());
log.info("After filtering {} left", result.size()); log.info("course page with {} courses, after filtering {} left", keysPage.courseKeys, result.size());
return result; return result;
} catch (final Exception e) { } catch (final Exception e) {