Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amend: remove CompensateRateLimiter #1034

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import com.itangcent.idea.binder.DbBeanBinderFactory
import com.itangcent.idea.icons.EasyIcons
import com.itangcent.idea.icons.iconOnly
import com.itangcent.idea.plugin.api.call.ApiCallUI
import com.itangcent.idea.plugin.utils.CompensateRateLimiter
import com.itangcent.idea.psi.resourceClass
import com.itangcent.idea.psi.resourceMethod
import com.itangcent.idea.swing.onSelect
import com.itangcent.idea.swing.onTextChange
import com.itangcent.idea.utils.*
import com.itangcent.intellij.extend.rx.ThrottleHelper
import com.itangcent.intellij.extend.rx.throttle
import com.itangcent.intellij.extend.withBoundary
import com.itangcent.intellij.file.LocalFileRepository
import com.itangcent.intellij.psi.PsiClassUtils
Expand Down Expand Up @@ -105,8 +105,6 @@ class ApiCallDialog : ContextDialog(), ApiCallUI {
{ NULL_REQUEST_INFO_CACHE }
}

private val rateLimiter = CompensateRateLimiter.create(10)

private val throttleHelper = ThrottleHelper()

private val requestChangeThrottle = throttleHelper.build("request")
Expand Down Expand Up @@ -203,24 +201,22 @@ class ApiCallDialog : ContextDialog(), ApiCallUI {
}
}

private fun resize() {
rateLimiter.tryAcquire {
actionContext.runInSwingUI {
val rightWidth = this.contentPane.width - this.apisListPanel.width
private val resize = {
actionContext.runInSwingUI {
val rightWidth = this.contentPane.width - this.apisListPanel.width

val rightPanel = this.rightPanel
rightPanel.setSizeIfNecessary(rightWidth, this.contentPane.height - 6)
val rightPanel = this.rightPanel
rightPanel.setSizeIfNecessary(rightWidth, this.contentPane.height - 6)

val requestPanel = this.requestPanel
requestPanel.setSizeIfNecessary(rightWidth - 30, requestPanel.height)
val requestPanel = this.requestPanel
requestPanel.setSizeIfNecessary(rightWidth - 30, requestPanel.height)

this.responsePanel.let {
it.setSizeIfNecessary(rightWidth - 30, it.height)
it.bottomAlignTo(this.apisJList)
}
this.responsePanel.let {
it.setSizeIfNecessary(rightWidth - 30, it.height)
it.bottomAlignTo(this.apisJList)
}
}
}
}.throttle(50, TimeUnit.MILLISECONDS)

//region api module
private fun initApisModule() {
Expand Down

This file was deleted.

This file was deleted.