mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 06:18:06 +01:00
Don't insert message batches in transactions.
This commit is contained in:
committed by
Jon Chambers
parent
65e585e122
commit
16eefe333f
@@ -65,7 +65,7 @@ public class Messages {
|
||||
}
|
||||
|
||||
public void store(final List<Envelope> messages, final String destination, final long destinationDevice) {
|
||||
database.use(jdbi -> jdbi.useTransaction(handle -> {
|
||||
database.use(jdbi -> jdbi.useHandle(handle -> {
|
||||
try (final Timer.Context ignored = storeTimer.time()) {
|
||||
final PreparedBatch batch = handle.prepareBatch("INSERT INTO messages (" + GUID + ", " + TYPE + ", " + RELAY + ", " + TIMESTAMP + ", " + SERVER_TIMESTAMP + ", " + SOURCE + ", " + SOURCE_UUID + ", " + SOURCE_DEVICE + ", " + DESTINATION + ", " + DESTINATION_DEVICE + ", " + MESSAGE + ", " + CONTENT + ") " +
|
||||
"VALUES (:guid, :type, :relay, :timestamp, :server_timestamp, :source, :source_uuid, :source_device, :destination, :destination_device, :message, :content)");
|
||||
|
||||
Reference in New Issue
Block a user