mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-05-06 11:20:21 +00:00
Fix SQLiteException in resolveRecipient by checking cache before opening connection (#2011)
This commit is contained in:
parent
2651823d4d
commit
132dfb95dc
@ -184,12 +184,12 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
|
||||
|
||||
@Override
|
||||
public RecipientId resolveRecipient(final ServiceId serviceId) {
|
||||
final var recipientWithAddress = recipientAddressCache.get(serviceId);
|
||||
if (recipientWithAddress != null) {
|
||||
return recipientWithAddress.id();
|
||||
}
|
||||
try (final var connection = database.getConnection()) {
|
||||
connection.setAutoCommit(false);
|
||||
final var recipientWithAddress = recipientAddressCache.get(serviceId);
|
||||
if (recipientWithAddress != null) {
|
||||
return recipientWithAddress.id();
|
||||
}
|
||||
final var recipientId = resolveRecipientLocked(connection, serviceId);
|
||||
connection.commit();
|
||||
return recipientId;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user