Skip to content

Commit 2ce16c3

Browse files
committed
initialize once per IDE startup
1 parent a4427ab commit 2ce16c3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/notifications/NotificationServiceInitializer.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ import com.intellij.openapi.startup.ProjectActivity
88
import java.util.concurrent.atomic.AtomicBoolean
99

1010
internal class NotificationServiceInitializer : ProjectActivity {
11-
companion object {
12-
private val initialized = AtomicBoolean(false)
13-
}
11+
12+
private val initialized = AtomicBoolean(false)
1413

1514
override suspend fun execute(project: Project) {
16-
val service = NotificationPollingService.getInstance()
17-
ProcessNotificationsBase()
1815
if (initialized.compareAndSet(false, true)) {
16+
val service = NotificationPollingService.getInstance()
17+
ProcessNotificationsBase()
1918
service.startPolling()
2019
}
2120
}

0 commit comments

Comments
 (0)