mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 14:38:51 +00:00
Make database optional
This commit is contained in:
2 files changed
+9
-4
No files matched your search
+7
-2
@@ -43,8 +43,13 @@ public class RedisMessageService implements MessageService {
|
||||
public RedisMessageService(final @NonNull CarbonChat carbonChat, final @NonNull RedisCredentials credentials) {
|
||||
this.carbonChat = carbonChat;
|
||||
|
||||
final RedisURI.Builder builder = RedisURI.Builder.redis(credentials.host(), credentials.port())
|
||||
.withDatabase(credentials.database());
|
||||
final RedisURI.Builder builder = RedisURI.Builder.redis(credentials.host(), credentials.port());
|
||||
|
||||
final Integer database = credentials.database();
|
||||
|
||||
if (database != null) {
|
||||
builder.withDatabase(database);
|
||||
}
|
||||
|
||||
final String password = credentials.password();
|
||||
|
||||
|
||||
Reference in new issue
Block a user