Skip to content

Commit

Permalink
Clearing the cache and added log to debug issue
Browse files Browse the repository at this point in the history
  • Loading branch information
karthik-tarento committed Aug 17, 2023
1 parent e49887f commit d649e4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.sunbird.common.dto.HeaderParam;
import org.sunbird.common.dto.Request;
import org.sunbird.common.dto.Response;
import org.sunbird.telemetry.logger.TelemetryManager;
import org.sunbird.telemetry.util.TelemetryAccessEventUtil;

import java.io.IOException;
Expand Down Expand Up @@ -56,6 +57,11 @@ public static void writeTelemetryEventLog(RequestWrapper requestWrapper, Respons
data.put("X-Authenticated-Userid", requestWrapper.getHeader("X-Authenticated-Userid"));
writeTelemetryEventLog(data);
} catch (IOException e) {
try {
TelemetryManager.info(String.format("Failed to process Event. exception: %s, received data: %s",
e.getMessage(), mapper.writeValueAsString(requestWrapper)));
} catch (Exception err) {
}
e.printStackTrace();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ public Response updateAllContents(String originalId, Map<String, Object> inputMa
if(checkError(imageUpdateResponse) || null == updateResponse)
return imageUpdateResponse;
}

//Clear redis cache after update is successful.
TelemetryManager.info("Update is successful for ID: " + originalId + ", Cache is cleared.");
clearRedisCache(originalId);

return updateResponse;
}
}
Expand Down

0 comments on commit d649e4f

Please sign in to comment.