Skip to content

Commit

Permalink
redis is now audited
Browse files Browse the repository at this point in the history
  • Loading branch information
nicol committed Sep 10, 2023
1 parent d6d688a commit 98dc715
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/main/java/org/beta/RedisDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}
};

Expand Down

0 comments on commit 98dc715

Please sign in to comment.