Skip to content

Commit

Permalink
Now that we track when sessions have been persisted (or were loaded f…
Browse files Browse the repository at this point in the history
…rom persistence) in each thread and have good dirty session detection, we shouldn't need to serialize the session into Redis unless it is not yet persisted or has changed.
  • Loading branch information
jcoleman committed Aug 26, 2011
1 parent afa3f3b commit cc00902
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,11 @@ public void save(Session session) throws IOException {

redisSession.resetDirtyTracking();
byte[] binaryId = redisSession.getId().getBytes();
byte[] data = serializer.serializeFrom(redisSession);

jedis = acquireConnection();

if (sessionIsDirty || currentSessionIsPersisted.get() != true) {
jedis.set(binaryId, data);
} else {
jedis.setnx(binaryId, data);
jedis.set(binaryId, serializer.serializeFrom(redisSession));
}

currentSessionIsPersisted.set(true);
Expand Down

0 comments on commit cc00902

Please sign in to comment.