diff --git a/.vscode/launch.json b/.vscode/launch.json index 6e4125c..133fb6e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -41,6 +41,24 @@ }, "args": [], "cwd": "${workspaceFolder}" - } + }, +{ + "type": "lldb", + "request": "launch", + "name": "Debug executable 'groupper_report'", + "cargo": { + "args": [ + "build", + "--bin=groupped_repport", + "--package=piperun-bot" + ], + "filter": { + "name": "groupped_repport", + "kind": "bin" + } + }, + "args": ["cargo", "run", "--bin=groupped_repport"], + "cwd": "${workspaceFolder}" + }, ] } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 810f33a..ba2e7f3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -459,6 +459,8 @@ fn get_piperun_chats_on_date(PIPERUN_API_URL: &String, client: &reqwest::blockin let current_page = json_response["current_page"].as_i64().expect("Failed to obtain current page number"); let last_page = json_response["last_page"].as_i64().expect("Failed to obtain current page number"); + if current_page == last_page { return aggregated_talks; } + let mut all_other_messages = (current_page..last_page).into_iter() .map(|page| { let page_to_request = page + 1;