Skip to content

Commit

Permalink
IJMP-1623: fix refreshing of node that contains an error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzianis Lisiankou authored and Dzianis Lisiankou committed Apr 16, 2024
1 parent 6162706 commit 7af1c66
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import eu.ibagroup.formainframe.explorer.ExplorerUnit
import eu.ibagroup.formainframe.utils.castOrNull
import eu.ibagroup.formainframe.utils.locked
import eu.ibagroup.formainframe.utils.service
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.locks.ReentrantLock
import kotlin.concurrent.withLock

Expand All @@ -43,8 +42,6 @@ abstract class FileFetchNode<Connection: ConnectionConfigBase, Value : Any, R :
private val lock = ReentrantLock()
private val condition = lock.newCondition()

private val hasError = AtomicBoolean(false)

private val connectionError = "Error: Check connection"

@Volatile
Expand Down Expand Up @@ -135,7 +132,6 @@ abstract class FileFetchNode<Connection: ConnectionConfigBase, Value : Any, R :
(fetched?.toChildrenNodes()?.toMutableList() ?: mutableListOf()).apply { add(loadingNode) }
}
} else {
hasError.set(true)
errorNode(
if (unit.connectionConfig == null) {
connectionError
Expand Down Expand Up @@ -179,9 +175,7 @@ abstract class FileFetchNode<Connection: ConnectionConfigBase, Value : Any, R :
sendTopic: Boolean = true
) {
val children = cachedChildren
if (!hasError.compareAndSet(true, false)) {
cachedChildren = null
}
cachedChildren = null
if (cleanFetchProviderCache) {
query?.let {
fileFetchProvider.cleanCache(it, sendTopic)
Expand Down

0 comments on commit 7af1c66

Please sign in to comment.