Skip to content

Commit 4d274b3

Browse files
committed
fix leetcode.com RunCode fix #77
1 parent 481d373 commit 4d274b3

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

doc/leetcode-editor-V5.3.zip

2.75 MB
Binary file not shown.

doc/leetcode-editor.zip

162 Bytes
Binary file not shown.

resources/META-INF/plugin.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin>
22
<id>leetcode-editor</id>
33
<name>leetcode editor</name>
4-
<version>5.2</version>
4+
<version>5.3</version>
55
<vendor email="shuzijun0109@gmail.com" url="https://github.com/shuzijun/idea-leetcode-plugin">shuzijun</vendor>
66

77
<description><![CDATA[
@@ -113,6 +113,12 @@
113113

114114
<change-notes><![CDATA[
115115
<ul>
116+
<li>v5.3<br>
117+
1.修复leetcode.com Run Code 超时问题<br>
118+
</li>
119+
<li>v5.3<br>
120+
1.fix leetcode.com RunCode Wait result timeout<br>
121+
</li>
116122
<li>v5.2<br>
117123
1.修复登陆提示<br>
118124
2.修复leetcode-cn列表无法展示问题<br>

src/com/shuzijun/leetcode/plugin/manager/CodeManager.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ public static void SubmitCode(Question question) {
179179
JSONObject returnObj = JSONObject.parseObject(body);
180180
cachedThreadPool.execute(new SubmitCheckTask(returnObj, codeTypeEnum, question));
181181
MessageUtils.showInfoMsg("info", PropertiesUtils.getInfo("request.pending"));
182+
}else if(response != null && response.getStatusLine().getStatusCode() == 429){
183+
MessageUtils.showInfoMsg("info", PropertiesUtils.getInfo("request.pending"));
182184
} else {
183185
LogUtils.LOG.error("提交失败:url:" + post.getURI().getPath() + ";param:" + arg.toJSONString() + ";body:" + EntityUtils.toString(response.getEntity(), "UTF-8"));
184186
MessageUtils.showWarnMsg("error", PropertiesUtils.getInfo("request.failed"));
@@ -441,6 +443,9 @@ public RunCodeCheckTask(JSONObject returnObj) {
441443
@Override
442444
public void run() {
443445
String key = returnObj.getString("interpret_expected_id");
446+
if(StringUtils.isBlank(key)){
447+
key = returnObj.getString("interpret_id");
448+
}
444449
for (int i = 0; i < 50; i++) {
445450
String body = null;
446451
try {
@@ -458,6 +463,9 @@ public void run() {
458463
String input = returnObj.getString("test_case");
459464
String output = jsonObject.getJSONArray("code_answer").getString(0);
460465
String expected = returnObj.getJSONArray("expected_code_answer").getString(0);
466+
if(StringUtils.isBlank(expected)){
467+
expected = jsonObject.getJSONArray("expected_code_answer").getString(0);
468+
}
461469
MessageUtils.showInfoMsg("info", PropertiesUtils.getInfo("test.success", input, output, expected));
462470
} else {
463471
MessageUtils.showInfoMsg("info", PropertiesUtils.getInfo("submit.run.failed", jsonObject.getString("full_compile_error")));

0 commit comments

Comments
 (0)