remove invoice auto collection on nwc_url update
Docker / build-and-push-image (backend, backend, coracle/caravel-backend) (push) Failing after 4m50s
Docker / build-and-push-image (frontend, frontend, coracle/caravel-frontend) (push) Successful in 2m44s

This commit is contained in:
Jon Staab
2026-05-15 12:54:40 -07:00
parent cd7b84439e
commit 6abe62b569
+1 -16
View File
@@ -110,7 +110,7 @@ pub async fn update_tenant(
api.require_admin_or_tenant(&auth, &pubkey)?;
let mut tenant = api.get_tenant_or_404(&pubkey).await?;
let nwc_previously_empty = tenant.nwc_url.is_empty();
// Encrypt tenant's nwc_url at rest
if let Some(nwc_url) = payload.nwc_url {
if nwc_url.is_empty() {
tenant.nwc_url = String::new();
@@ -120,21 +120,6 @@ pub async fn update_tenant(
}
api.command.update_tenant(&tenant).await.map_err(internal)?;
// When NWC is first connected, attempt to pay any outstanding open invoices.
if nwc_previously_empty && !tenant.nwc_url.is_empty() {
let billing = api.billing.clone();
let tenant_clone = tenant.clone();
tokio::spawn(async move {
if let Err(e) = billing.pay_outstanding_nwc_invoices(&tenant_clone).await {
tracing::error!(
error = %e,
pubkey = %tenant_clone.pubkey,
"pay_outstanding_nwc_invoices failed after NWC setup"
);
}
});
}
ok(TenantResponse::from(tenant))
}