MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / remove_devices

Function remove_devices

chirpstack/src/storage/fuota.rs:501–515  ·  view source on GitHub ↗
(fuota_deployment_id: Uuid, dev_euis: Vec<EUI64>)

Source from the content-addressed store, hash-verified

499}
500
501pub async fn remove_devices(fuota_deployment_id: Uuid, dev_euis: Vec<EUI64>) -> Result<(), Error> {
502 diesel::delete(
503 fuota_deployment_device::table
504 .filter(
505 fuota_deployment_device::dsl::fuota_deployment_id
506 .eq(fields::Uuid::from(fuota_deployment_id)),
507 )
508 .filter(fuota_deployment_device::dsl::dev_eui.eq_any(&dev_euis)),
509 )
510 .execute(&mut get_async_db_conn().await?)
511 .await?;
512
513 info!(fuota_deployment_id = %fuota_deployment_id, "DevEUIs removed from FUOTA Deployment");
514 Ok(())
515}
516
517pub async fn get_device_count(fuota_deployment_id: Uuid) -> Result<i64, Error> {
518 fuota_deployment_device::dsl::fuota_deployment_device

Callers 2

test_fuota_devicesFunction · 0.85
remove_devicesMethod · 0.85

Calls 2

deleteFunction · 0.70
get_async_db_connFunction · 0.70

Tested by 1

test_fuota_devicesFunction · 0.68