Skip to content

Commit

Permalink
Make reply of ACL LOG compatible with older Redis versions (#4030)
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 authored Nov 27, 2024
1 parent eb6cc47 commit 74795cb
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ public AccessControlLogEntry(Map<String, Object> map) {
ageSeconds = (Double) map.get(AGE_SECONDS);
clientInfo = getMapFromRawClientInfo((String) map.get(CLIENT_INFO));
logEntry = map;
entryId = (long) map.get(ENTRY_ID);
timestampCreated = (long) map.get(TIMESTAMP_CREATED);
timestampLastUpdated = (long) map.get(TIMESTAMP_LAST_UPDATED);
// Redis 7.2
entryId = map.containsKey(ENTRY_ID) ? (long) map.get(ENTRY_ID) : -1L;
timestampCreated = map.containsKey(TIMESTAMP_CREATED) ? (long) map.get(TIMESTAMP_CREATED) : -1L;
timestampLastUpdated = map.containsKey(TIMESTAMP_LAST_UPDATED) ? (long) map.get(TIMESTAMP_LAST_UPDATED) : -1L;
}

public long getCount() {
Expand Down

0 comments on commit 74795cb

Please sign in to comment.