mirror of
https://github.com/daywalker90/cln-nip47.git
synced 2026-08-13 12:33:43 +02:00
fix nwc-create rpc erroring if running nwc failed, log instead since we already persist it
This commit is contained in:
parent
101234e8ef
commit
a26eb7a539
2 changed files with 7 additions and 5 deletions
|
|
@ -79,10 +79,10 @@ pub fn parse_time_period(input: &str) -> Result<u64, anyhow::Error> {
|
|||
if let Ok(time_unit) = unit.parse() {
|
||||
match time_unit {
|
||||
TimeUnit::Second => Ok(value),
|
||||
TimeUnit::Minute => Ok(value * 60),
|
||||
TimeUnit::Hour => Ok(value * 60 * 60),
|
||||
TimeUnit::Day => Ok(value * 60 * 60 * 24),
|
||||
TimeUnit::Week => Ok(value * 60 * 60 * 24 * 7),
|
||||
TimeUnit::Minute => Ok(value.saturating_mul(60)),
|
||||
TimeUnit::Hour => Ok(value.saturating_mul(60 * 60)),
|
||||
TimeUnit::Day => Ok(value.saturating_mul(60 * 60 * 24)),
|
||||
TimeUnit::Week => Ok(value.saturating_mul(60 * 60 * 24 * 7)),
|
||||
}
|
||||
} else {
|
||||
Err(anyhow!(format!("Unsupported time unit: {unit}")))
|
||||
|
|
|
|||
|
|
@ -95,7 +95,9 @@ pub async fn nwc_create(
|
|||
})
|
||||
.await?;
|
||||
|
||||
run_nwc(plugin.clone(), label.clone(), nwc_store.clone()).await?;
|
||||
if let Err(e) = run_nwc(plugin.clone(), label.clone(), nwc_store.clone()).await {
|
||||
log::warn!("Failed running nwc: {e}");
|
||||
}
|
||||
|
||||
Ok(serde_json::Value::Object(result))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue