Shorten lifespan of buffered store.

This commit is contained in:
Greyson Parrelli
2023-03-24 14:24:43 -04:00
parent 5914a4d1cf
commit 87918da943

View File

@@ -398,14 +398,13 @@ class IncomingMessageObserver(private val context: Application) {
signalWebSocket.connect()
try {
val bufferedStore = BufferedProtocolStore.create()
while (isConnectionNecessary()) {
try {
Log.d(TAG, "Reading message...")
val hasMore = signalWebSocket.readMessageBatch(WEBSOCKET_READ_TIMEOUT, 30) { batch ->
Log.i(TAG, "Retrieved ${batch.size} envelopes!")
val bufferedStore = BufferedProtocolStore.create()
val startTime = System.currentTimeMillis()
ReentrantSessionLock.INSTANCE.acquire().use {