println("Background sync")
try {
val pending = Database.getPendingFeeds(1 * 60)
- SyncJob { pending }.syncBlocking()
- GlobalScope.launch(ToolkitDispatcher) {
- window!!.sourceList.invalidateCache()
- window!!.sourceList.reloadStatus()
- window!!.feedList.reloadCurrentFeed()
+ if(!pending.isEmpty()) {
+ SyncJob { pending }.syncBlocking()
+ GlobalScope.launch(ToolkitDispatcher) {
+ window!!.sourceList.invalidateCache()
+ window!!.sourceList.reloadStatus()
+ window!!.feedList.reloadCurrentFeed()
+ }
}
} catch (e: Exception) {
e.printStackTrace()