Skip to content

Commit

Permalink
优化initBaiduAip,避免重复调用
Browse files Browse the repository at this point in the history
  • Loading branch information
WYH2004-MC committed Mar 27, 2023
1 parent ded93b7 commit 18db893
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/kotlin/BotCensor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ object BotCensor : KotlinPlugin(
}

fun initBaiduAip(){
client = AipContentCensor(DefaultConfig.App_Id, DefaultConfig.App_Key, DefaultConfig.Secret_Key)
client.setConnectionTimeoutInMillis(2000)
client.setSocketTimeoutInMillis(60000)
client = AipContentCensor(
DefaultConfig.App_Id,
DefaultConfig.App_Key,
DefaultConfig.Secret_Key
).apply {
setConnectionTimeoutInMillis(2000)
setSocketTimeoutInMillis(60000)
}
}

fun regConfig(){
Expand Down

0 comments on commit 18db893

Please sign in to comment.