mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Remove job adds from database transactions.
This commit is contained in:
@@ -1302,7 +1302,6 @@ public class MmsDatabase extends MessageDatabase {
|
||||
}
|
||||
|
||||
notifyConversationListeners(threadId);
|
||||
ApplicationDependencies.getJobManager().add(new TrimThreadJob(threadId));
|
||||
|
||||
return Optional.of(new InsertResult(messageId, threadId));
|
||||
}
|
||||
|
||||
@@ -866,13 +866,16 @@ public class SmsDatabase extends MessageDatabase {
|
||||
db.insert(TABLE_NAME, null, values);
|
||||
|
||||
notifyConversationListeners(threadId);
|
||||
ApplicationDependencies.getJobManager().add(new TrimThreadJob(threadId));
|
||||
});
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
|
||||
Stream.of(threadIdsToUpdate)
|
||||
.withoutNulls()
|
||||
.forEach(threadId -> ApplicationDependencies.getJobManager().add(new TrimThreadJob(threadId)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user