logging
This commit is contained in:
parent
bbf241b08e
commit
03563a50ed
1 changed files with 7 additions and 1 deletions
|
@ -267,6 +267,8 @@ public class MoodleCourseAccess extends CourseAccess {
|
||||||
courseKeyPageJSON,
|
courseKeyPageJSON,
|
||||||
CoursePage.class);
|
CoursePage.class);
|
||||||
|
|
||||||
|
log.info("Got course page with: {} items", keysPage.courseKeys.size());
|
||||||
|
|
||||||
// get courses
|
// get courses
|
||||||
final Set<String> ids = keysPage.courseKeys
|
final Set<String> ids = keysPage.courseKeys
|
||||||
.stream()
|
.stream()
|
||||||
|
@ -274,7 +276,7 @@ public class MoodleCourseAccess extends CourseAccess {
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
final long now = DateTime.now(DateTimeZone.UTC).getMillis();
|
final long now = DateTime.now(DateTimeZone.UTC).getMillis();
|
||||||
return getCoursesForIds(restTemplate, ids)
|
final Collection<CourseData> result = getCoursesForIds(restTemplate, ids)
|
||||||
.stream()
|
.stream()
|
||||||
.filter(course -> course.time_created == null
|
.filter(course -> course.time_created == null
|
||||||
|| course.time_created.longValue() > aYearAgo
|
|| course.time_created.longValue() > aYearAgo
|
||||||
|
@ -282,6 +284,10 @@ public class MoodleCourseAccess extends CourseAccess {
|
||||||
|| (course.end_date <= 0
|
|| (course.end_date <= 0
|
||||||
|| course.end_date > now)))
|
|| course.end_date > now)))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
log.info("After filtering {} left", result.size());
|
||||||
|
|
||||||
|
return result;
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
log.error("Unexpected error while trying to get courses page: ", e);
|
log.error("Unexpected error while trying to get courses page: ", e);
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
|
Loading…
Reference in a new issue