[snowpatch] [PATCH] patchwork: Increase number of items returned per page to 500

Andrew Donnellan andrew.donnellan at au1.ibm.com
Tue Feb 26 13:38:38 AEDT 2019


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 at russell.cc>
[ajd: format as patch, add commit message]
Signed-off-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

---

Already applied, for information only


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

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
     }
 
-- 
2.11.0



More information about the snowpatch mailing list