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

同时发起两次post请求,会抛异常“Only allowed to configure once.” #126

Open
PuChangyu opened this issue Jul 21, 2023 · 1 comment

Comments

@PuChangyu
Copy link

同时发起两次post请求,会抛异常“Only allowed to configure once.”,Kalle的Config处理有问题
不得已,我只能自己在初始化的时候加个锁
var post: SimpleBodyRequest.Api synchronized(lock) { post = Kalle.post(url) } val perform = post .setHeaders(headers) .connectTimeout(5, TimeUnit.SECONDS) .body(getRequestBody(cipherString.toString())) .converter(Converter.DEFAULT) .perform<String, String>( String::class.java, String::class.java )

@PuChangyu
Copy link
Author

var post: SimpleBodyRequest.Api
synchronized(lock) {
post = Kalle.post(url)
}
val perform = post.setHeaders(headers)
.connectTimeout(5, TimeUnit.SECONDS)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant