fix duplicate plugin update notifications: don't queue the next plugin update while the network request from the previous update is still running

This commit is contained in:
Dmitry Jemerov
2015-11-09 14:28:53 +01:00
parent a5771c6c1c
commit 1d01565262
@@ -71,8 +71,6 @@ class KotlinPluginUpdater(val propertiesComponent: PropertiesComponent) : Dispos
private fun updateCheck() { private fun updateCheck() {
try { try {
checkQueued = false
var (mainRepoUpdateSuccess, latestVersionInRepository) = getPluginVersionFromMainRepository() var (mainRepoUpdateSuccess, latestVersionInRepository) = getPluginVersionFromMainRepository()
var descriptorToInstall: IdeaPluginDescriptor? = null var descriptorToInstall: IdeaPluginDescriptor? = null
var hostToInstallFrom: String? = null var hostToInstallFrom: String? = null
@@ -94,6 +92,8 @@ class KotlinPluginUpdater(val propertiesComponent: PropertiesComponent) : Dispos
} }
} }
checkQueued = false
if (mainRepoUpdateSuccess || latestVersionInRepository != null) { if (mainRepoUpdateSuccess || latestVersionInRepository != null) {
recordSuccessfulUpdateCheck() recordSuccessfulUpdateCheck()
if (latestVersionInRepository != null && VersionComparatorUtil.compare(latestVersionInRepository, KotlinPluginUtil.getPluginVersion()) > 0) { if (latestVersionInRepository != null && VersionComparatorUtil.compare(latestVersionInRepository, KotlinPluginUtil.getPluginVersion()) > 0) {