Skip to content

Commit

Permalink
Comment out entire body of doJob() to assess bottleneck
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima committed Aug 30, 2024
1 parent 1ac33b2 commit 49cd7a1
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/main/java/org/wise/portal/domain/admin/DailyAdminJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,36 +126,36 @@ public class DailyAdminJob {
@Scheduled(cron = "0 0 0 * * ?")
public void doJob() {
// query for the portal statistics and save a new row in the portalStatistics table
gatherPortalStatistics();
// gatherPortalStatistics();

// query the vle tables and save a new row in the vleStatistics table
// too process-intensive, also, looking at out-of-date tables (e.g. studentData)
// gatherVLEStatistics();

// create and send a message to uber_admin
String messageBody = getSummaryMessage();
sendEmail(messageBody);
// String messageBody = getSummaryMessage();
// sendEmail(messageBody);

// post statistics to hub if allowed
try {
Portal portal = portalService.getById(1);
if (portal.isSendStatisticsToHub()) {
try {
JSONObject wiseStatisticsJSONObject = new JSONObject();
wiseStatisticsJSONObject.put("wiseName", appProperties.getProperty("wise.name"));

PortalStatistics latestPortalStatistics = portalStatisticsService
.getLatestPortalStatistics();
wiseStatisticsJSONObject.put("portal", latestPortalStatistics.getJSONObject());
postStatistics(wiseStatisticsJSONObject.toString());
} catch (JSONException e) {
e.printStackTrace();
}

}
} catch (ObjectNotFoundException e) {
// do nothing
}
// try {
// Portal portal = portalService.getById(1);
// if (portal.isSendStatisticsToHub()) {
// try {
// JSONObject wiseStatisticsJSONObject = new JSONObject();
// wiseStatisticsJSONObject.put("wiseName", appProperties.getProperty("wise.name"));

// PortalStatistics latestPortalStatistics = portalStatisticsService
// .getLatestPortalStatistics();
// wiseStatisticsJSONObject.put("portal", latestPortalStatistics.getJSONObject());
// postStatistics(wiseStatisticsJSONObject.toString());
// } catch (JSONException e) {
// e.printStackTrace();
// }

// }
// } catch (ObjectNotFoundException e) {
// // do nothing
// }
}

/**
Expand Down

0 comments on commit 49cd7a1

Please sign in to comment.