diff --git a/src/main/java/org/beta/RedisDAO.java b/src/main/java/org/beta/RedisDAO.java index 46d19a339..37752d4a0 100644 --- a/src/main/java/org/beta/RedisDAO.java +++ b/src/main/java/org/beta/RedisDAO.java @@ -72,25 +72,22 @@ public void init() throws SQLException { @Override public void commandStarted(CommandStartedEvent event) { obj = new DAOInfo(); - obj.setQuery(event.getCommand().toString()); + obj.setDaoName(getName()); + obj.setConnectionName(getDBLocation()); + obj.setQuery(event.getCommand().getType() + " " + event.getCommand().getArgs().toCommandString()); } @Override public void commandFailed(CommandFailedEvent event) { + obj.setEnd(Instant.now()); obj.setMessage(event.getCause().getMessage()); - save(event); + TechnicalServiceManager.inst().store(obj); } @Override public void commandSucceeded(CommandSucceededEvent event) { - save(event); - } - - private void save(CommandBaseEvent event) { obj.setEnd(Instant.now()); - TechnicalServiceManager.inst().store(obj); - } };