diff mbox series

patchwork: Increase number of items returned per page to 500

Message ID 20190226023838.23818-1-andrew.donnellan@au1.ibm.com
State Accepted
Headers show
Series patchwork: Increase number of items returned per page to 500 | expand

Commit Message

Andrew Donnellan Feb. 26, 2019, 2:38 a.m. UTC
This is needed at least while pagination is still broken to decrease the
likelihood that we miss patches when large series are sent. One day we
might be able to get rid of it, but in any case fetching 500 at a time is
likely to be more efficient.

Co-authored-by: Russell Currey <ruscur@russell.cc>
[ajd: format as patch, add commit message]
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

---

Already applied, for information only


---
 src/patchwork.rs | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/src/patchwork.rs b/src/patchwork.rs
index 1c2d3821300b..8f01186084d5 100644
--- a/src/patchwork.rs
+++ b/src/patchwork.rs
@@ -39,7 +39,7 @@  use utils;
 
 // TODO: more constants.  constants for format strings of URLs and such.
 pub static PATCHWORK_API: &'static str = "/api/1.0";
-pub static PATCHWORK_QUERY: &'static str = "?order=-id";
+pub static PATCHWORK_QUERY: &'static str = "?order=-id&count=500";
 
 #[derive(Deserialize, Clone)]
 pub struct SubmitterSummary {
@@ -243,7 +243,8 @@  impl PatchworkServer {
                     format!(
                         "Basic {}",
                         base64::encode(&format!("{}:{}", username, password))
-                    ).parse()
+                    )
+                    .parse()
                     .unwrap(),
                 );
             }
@@ -310,15 +311,15 @@  impl PatchworkServer {
 
     fn get_next_link(&self, _resp: &Response) -> Option<String> {
         /*
-        let next = resp.headers().get(LINK)?;
-        for val in next.values() {
-            if let Some(rel) = val.rel() {
-                if rel.iter().any(|reltype| reltype == &RelationType::Next) {
-                    return Some(val.link().to_string());
+                let next = resp.headers().get(LINK)?;
+                for val in next.values() {
+                    if let Some(rel) = val.rel() {
+                        if rel.iter().any(|reltype| reltype == &RelationType::Next) {
+                            return Some(val.link().to_string());
+                        }
+                    }
                 }
-            }
-        }
-*/
+        */
         None
     }