Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 90f7bad

Browse files
authored
[Bugfix] Removes test_mode parameter (clearloop#25)
Scope: when test_mode parameter is sent to Leetcode it does not respond with a valid interpret_id. This leads to 404 when trying to check for submission results. This fixes submit functionallity as well. Changes: - Adds additional tracing - Removes test_mode parameter
1 parent 87eb0b9 commit 90f7bad

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

β€Žsrc/cache/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ impl Cache {
222222

223223
json.insert("lang", conf.code.lang.to_string());
224224
json.insert("question_id", p.id.to_string());
225-
json.insert("test_mode", false.to_string());
226225
json.insert("typed_code", code);
227226

228227
// pass manually data
@@ -285,16 +284,17 @@ impl Cache {
285284
testcase: Option<String>,
286285
) -> Result<VerifyResult, Error> {
287286
trace!("Exec problem filter β€”β€” Test or Submit");
288-
let pre = self.pre_run_code(run.clone(), rfid, testcase).await?;
289-
letjson = pre.0;
287+
let (json,[url, refer]) = self.pre_run_code(run.clone(), rfid, testcase).await?;
288+
trace!("Pre run code result {:?}, {:?}, {:?}",json, url, refer);
290289

291290
let run_res: RunCode = self
292291
.0
293292
.clone()
294-
.run_code(json.clone(), pre.1[0].clone(), pre.1[1].clone())
293+
.run_code(json.clone(), url.clone(), refer.clone())
295294
.await?
296295
.json()
297296
.await?;
297+
trace!("Run code result {:#?}", run_res);
298298

299299
let mut res: VerifyResult = VerifyResult::default();
300300
while res.state != "SUCCESS" {
@@ -303,6 +303,7 @@ impl Cache {
303303
Run::Submit => self.recur_verify(run_res.submission_id.to_string()).await?,
304304
};
305305
}
306+
trace!("Recur verify result {:#?}", res);
306307

307308
res.name = json.get("name")?.to_string();
308309
res.data_input = json.get("data_input")?.to_string();

0 commit comments

Comments
(0)

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /