Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

collab: Fetch more meters and prices when initializing `StripeBilling` (#19288)

Marshall Bowers9c3d80d6e8d1
diff --git a/crates/collab/src/stripe_billing.rs b/crates/collab/src/stripe_billing.rs
index c121d8e8fdd..f7cce28a3ad 100644
--- a/crates/collab/src/stripe_billing.rs
+++ b/crates/collab/src/stripe_billing.rs
@@ -45,7 +45,13 @@ impl StripeBilling {
let (meters, prices) = futures::try_join!(
StripeMeter::list(&self.client),
- stripe::Price::list(&self.client, &stripe::ListPrices::default())
+ stripe::Price::list(
+ &self.client,
+ &stripe::ListPrices {
+ limit: Some(100),
+ ..Default::default()
+ }
+ )
)?;
for meter in meters.data {
@@ -396,9 +402,12 @@ impl StripeMeter {
pub fn list(client: &stripe::Client) -> stripe::Response<stripe::List<Self>> {
#[derive(Serialize)]
- struct Params {}
+ struct Params {
+ #[serde(skip_serializing_if = "Option::is_none")]
+ limit: Option<u64>,
+ }
- client.get_query("/billing/meters", Params {})
+ client.get_query("/billing/meters", Params { limit: Some(100) })
}
}