Skip to content

Commit

Permalink
Merge pull request ozimov#16 from enisher/master
Browse files Browse the repository at this point in the history
Throw an exception if redis has not been started.
  • Loading branch information
kstyrc committed Sep 30, 2014
2 parents 9c458b3 + 436429c commit 185c6cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/redis/embedded/RedisServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,12 @@ private void awaitRedisServerReady() throws IOException {
String outputLine = null;
do {
outputLine = reader.readLine();
} while (outputLine != null && !outputLine.matches(REDIS_READY_PATTERN));

if (outputLine == null) {
//Something goes wrong. Stream is ended before server was activated.
throw new RuntimeException("Can't start redis server. Check logs for details.");
}
} while (!outputLine.matches(REDIS_READY_PATTERN));
} finally {
reader.close();
}
Expand Down

0 comments on commit 185c6cc

Please sign in to comment.