Skip to content

Commit 869e99c

Browse files
committed
Fix: poll the workspaces every 5 seconds
1 parent 43a1f6f commit 869e99c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
297297
}
298298

299299
private fun loadWorkspaces() {
300+
poller?.cancel()
301+
300302
poller = cs.launch {
301303
while (isActive) {
302304
val workspaceList = withContext(Dispatchers.IO) {
@@ -319,8 +321,8 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
319321
tableOfWorkspaces.selectItem(selectedWorkspace)
320322
}
321323
}
324+
delay(5000)
322325
}
323-
delay(5000)
324326
}
325327
}
326328

0 commit comments

Comments
 (0)