mirror of
https://github.com/YuWanTingbb/unofficial-gpt4.git
synced 2025-10-13 13:45:06 +00:00
feat 加入token超时日志
This commit is contained in:
@@ -584,6 +584,7 @@ public class ChatController {
|
||||
} else {
|
||||
int requestNum = copilotTokenLimitList.get(apiKey).incrementAndGet();
|
||||
if (requestNum > one_copilot_limit) {
|
||||
log.info(apiKey + " requests is " + requestNum + " rate limit exceeded");
|
||||
return new ResponseEntity<>(Result.error("current requests is " + requestNum + " rate limit exceeded"), HttpStatus.TOO_MANY_REQUESTS);
|
||||
}
|
||||
}
|
||||
@@ -667,6 +668,7 @@ public class ChatController {
|
||||
} else {
|
||||
int requestNum = coCopilotTokenLimitList.get(apiKey).incrementAndGet();
|
||||
if (requestNum > one_coCopilot_limit) {
|
||||
log.info(apiKey + " requests is " + requestNum + " rate limit exceeded");
|
||||
return new ResponseEntity<>(Result.error("current requests is " + requestNum + " rate limit exceeded"), HttpStatus.TOO_MANY_REQUESTS);
|
||||
}
|
||||
}
|
||||
@@ -753,6 +755,7 @@ public class ChatController {
|
||||
} else {
|
||||
int requestNum = selfTokenLimitList.get(apiKey).incrementAndGet();
|
||||
if (requestNum > one_selfCopilot_limit) {
|
||||
log.info(apiKey + " requests is " + requestNum + " rate limit exceeded");
|
||||
return new ResponseEntity<>(Result.error("current requests is " + requestNum + " rate limit exceeded"), HttpStatus.TOO_MANY_REQUESTS);
|
||||
}
|
||||
}
|
||||
@@ -871,6 +874,7 @@ public class ChatController {
|
||||
} else {
|
||||
int requestNum = copilotTokenLimitList.get(apiKey).incrementAndGet();
|
||||
if (requestNum > one_copilot_limit) {
|
||||
log.info(apiKey + " requests is " + requestNum + " rate limit exceeded");
|
||||
return new ResponseEntity<>(Result.error("current requests is " + requestNum + " rate limit exceeded"), HttpStatus.TOO_MANY_REQUESTS);
|
||||
}
|
||||
}
|
||||
@@ -969,6 +973,7 @@ public class ChatController {
|
||||
} else {
|
||||
int requestNum = coCopilotTokenLimitList.get(apiKey).incrementAndGet();
|
||||
if (requestNum > one_coCopilot_limit) {
|
||||
log.info(apiKey + " requests is " + requestNum + " rate limit exceeded");
|
||||
return new ResponseEntity<>(Result.error("current requests is " + requestNum + " rate limit exceeded"), HttpStatus.TOO_MANY_REQUESTS);
|
||||
}
|
||||
}
|
||||
@@ -1052,6 +1057,7 @@ public class ChatController {
|
||||
} else {
|
||||
int requestNum = selfTokenLimitList.get(apiKey).incrementAndGet();
|
||||
if (requestNum > one_selfCopilot_limit) {
|
||||
log.info(apiKey + " requests is " + requestNum + " rate limit exceeded");
|
||||
return new ResponseEntity<>(Result.error("current requests is " + requestNum + " rate limit exceeded"), HttpStatus.TOO_MANY_REQUESTS);
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -7,4 +7,4 @@ com\gpt4\copilot\pojo\Conversation.class
|
||||
com\gpt4\copilot\pojo\SystemSetting.class
|
||||
com\gpt4\copilot\config\CorsConfig.class
|
||||
com\gpt4\copilot\pojo\Result.class
|
||||
com\gpt4\copilot\CopilotApplication.class
|
||||
com\gpt4\copilot\copilotApplication.class
|
||||
|
@@ -5,4 +5,4 @@ F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\
|
||||
F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\pojo\SystemSetting.java
|
||||
F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\controller\ChatController.java
|
||||
F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\config\WebConfig.java
|
||||
F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\CopilotApplication.java
|
||||
F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\copilotApplication.java
|
||||
|
Reference in New Issue
Block a user