From 2cbca6d22d58033af507f70d5ede29c771e596e9 Mon Sep 17 00:00:00 2001 From: Jacksgong Date: Thu, 1 Feb 2018 23:02:33 +0800 Subject: [PATCH] feat: print sync to cache state to logcat when need_log is true --- .../com/liulishuo/filedownloader/database/RemitDatabase.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/src/main/java/com/liulishuo/filedownloader/database/RemitDatabase.java b/library/src/main/java/com/liulishuo/filedownloader/database/RemitDatabase.java index bf01fc85..7274b067 100644 --- a/library/src/main/java/com/liulishuo/filedownloader/database/RemitDatabase.java +++ b/library/src/main/java/com/liulishuo/filedownloader/database/RemitDatabase.java @@ -23,6 +23,7 @@ import com.liulishuo.filedownloader.model.ConnectionModel; import com.liulishuo.filedownloader.model.FileDownloadModel; import com.liulishuo.filedownloader.util.FileDownloadHelper; +import com.liulishuo.filedownloader.util.FileDownloadLog; import com.liulishuo.filedownloader.util.FileDownloadProperties; import com.liulishuo.filedownloader.util.FileDownloadUtils; @@ -88,6 +89,10 @@ public RemitDatabase() { } private void syncCacheToDB(int id) { + if (FileDownloadLog.NEED_LOG) { + FileDownloadLog.d(this, "sync cache to db %d", id); + } + realDatabase.update(cachedDatabase.find(id)); final List modelList = cachedDatabase.findConnectionModel(id); realDatabase.removeConnections(id);