From c167024212da777ab36b4dae0cae018063a939ef Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 7 Jun 2019 10:33:19 +0200 Subject: [PATCH] Limit number of ROOM tasks --- app/src/main/java/eu/faircode/email/DB.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/DB.java b/app/src/main/java/eu/faircode/email/DB.java index 965eef7a1c..aea2cedec8 100644 --- a/app/src/main/java/eu/faircode/email/DB.java +++ b/app/src/main/java/eu/faircode/email/DB.java @@ -95,7 +95,8 @@ public abstract class DB extends RoomDatabase { public abstract DaoLog log(); private static DB sInstance; - private static ExecutorService executor = Executors.newCachedThreadPool(Helper.foregroundThreadFactory); + private static ExecutorService executor = Executors.newFixedThreadPool( + Runtime.getRuntime().availableProcessors(), Helper.foregroundThreadFactory); private static final String DB_NAME = "fairemail";