diff --git a/src/main/java/org/sunbird/course/service/ExploreCourseServiceImpl.java b/src/main/java/org/sunbird/course/service/ExploreCourseServiceImpl.java index 14681741f..003369a8a 100644 --- a/src/main/java/org/sunbird/course/service/ExploreCourseServiceImpl.java +++ b/src/main/java/org/sunbird/course/service/ExploreCourseServiceImpl.java @@ -53,29 +53,18 @@ public SBApiResponse getExploreCourseList() { SBApiResponse response = ProjectUtil.createDefaultResponse(Constants.API_GET_EXPLORE_COURSE_DETAIL); String errMsg = ""; try { - Map responseCourseList = (Map) redisCacheMgr - .getCache(Constants.PUBLIC_COURSE_LIST); - - if (ObjectUtils.isEmpty(responseCourseList)) { - List> courseList = cassandraOperation.getRecordsByProperties( - Constants.SUNBIRD_KEY_SPACE_NAME, Constants.TABLE_EXPLORE_COURSE_LIST, MapUtils.EMPTY_MAP, - ListUtils.EMPTY_LIST); - List identifierList = new ArrayList(); - for (Map course : courseList) { - identifierList.add((String) course.get(Constants.IDENTIFIER)); - } - Map searchResponse = searchContent(identifierList); - if (!Constants.OK.equalsIgnoreCase((String) searchResponse.get(Constants.RESPONSE_CODE))) { - errMsg = "Failed to get contant details for Identifier List from DB."; - } else { - responseCourseList = (Map) searchResponse.get(Constants.RESULT); - redisCacheMgr.putCache(Constants.PUBLIC_COURSE_LIST, responseCourseList); - response.setResult(responseCourseList); - logger.info(String.format( - "Adding open course details into Cache. CourseId Count: %s, ContentSearch Count: %s", - identifierList.size(), responseCourseList.get(Constants.COUNT))); - } + List> courseList = cassandraOperation.getRecordsByProperties( + Constants.SUNBIRD_KEY_SPACE_NAME, Constants.TABLE_EXPLORE_COURSE_LIST, MapUtils.EMPTY_MAP, + ListUtils.EMPTY_LIST); + List identifierList = new ArrayList(); + for (Map course : courseList) { + identifierList.add((String) course.get(Constants.IDENTIFIER)); + } + Map searchResponse = searchContent(identifierList); + if (!Constants.OK.equalsIgnoreCase((String) searchResponse.get(Constants.RESPONSE_CODE))) { + errMsg = "Failed to get contant details for Identifier List from DB."; } else { + Map responseCourseList = (Map) searchResponse.get(Constants.RESULT); response.setResult(responseCourseList); } } catch (Exception e) {