优化 #5648
This commit is contained in:
@@ -65,11 +65,13 @@ object SourceVerificationHelp {
|
|||||||
LockSupport.parkNanos(this, waitTime)
|
LockSupport.parkNanos(this, waitTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
return getResult(source.getKey())!!.let {
|
val result = getResult(source.getKey())!!
|
||||||
it.ifBlank {
|
clearResult(source.getKey())
|
||||||
throw NoStackTraceException("验证结果为空")
|
result.ifBlank {
|
||||||
}
|
throw NoStackTraceException("验证结果为空")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -109,10 +111,7 @@ object SourceVerificationHelp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getResult(sourceKey: String): String? {
|
fun getResult(sourceKey: String): String? {
|
||||||
val key = getVerificationResultKey(sourceKey)
|
return CacheManager.getFromMemory(getVerificationResultKey(sourceKey)) as? String
|
||||||
val result = CacheManager.getFromMemory(key) as? String
|
|
||||||
CacheManager.deleteMemory(key)
|
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clearResult(sourceKey: String) {
|
fun clearResult(sourceKey: String) {
|
||||||
|
|||||||
Reference in New Issue
Block a user