Skip to content

Commit b8b6950

Browse files
committed
specify etag storage location
1 parent 5f140d4 commit b8b6950

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import com.intellij.openapi.Disposable
88
import com.intellij.openapi.application.ApplicationManager
99
import com.intellij.openapi.components.PersistentStateComponent
1010
import com.intellij.openapi.components.Service
11+
import com.intellij.openapi.components.State
12+
import com.intellij.openapi.components.Storage
13+
import com.intellij.openapi.components.RoamingType
1114
import com.intellij.util.Alarm
1215
import com.intellij.util.AlarmFactory
1316
import com.intellij.util.io.HttpRequests
@@ -38,7 +41,8 @@ object NotificationFileValidator : RemoteResolveParser {
3841
}
3942
}
4043

41-
object NotificationState : PersistentStateComponent<NotificationState.State> {
44+
@State(name = "NotificationETagState", storages = [Storage("aws.xml", roamingType = RoamingType.DISABLED)])
45+
object ETagState : PersistentStateComponent<ETagState.State> {
4246
data class State(
4347
var etag: String? = null,
4448
)
@@ -86,7 +90,7 @@ class NotificationPollingService : Disposable {
8690
while (retryCount < MAX_RETRIES) {
8791
try {
8892
val newETag = getNotificationETag()
89-
if (newETag == NotificationState.getState().etag) {
93+
if (newETag == ETagState.getState().etag) {
9094
if (firstPoll.compareAndSet(false, true)) {
9195
notifyObservers()
9296
}
@@ -96,7 +100,7 @@ class NotificationPollingService : Disposable {
96100
.resolve(notificationsResource)
97101
.toCompletableFuture()
98102
.get()
99-
NotificationState.getState().etag = newETag
103+
ETagState.getState().etag = newETag
100104
return true
101105
} catch (e: Exception) {
102106
lastException = e

0 commit comments

Comments
 (0)