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

Function update_item

chirpstack/src/storage/device_queue.rs:87–100  ·  view source on GitHub ↗
(qi: DeviceQueueItem)

Source from the content-addressed store, hash-verified

85}
86
87pub async fn update_item(qi: DeviceQueueItem) -> Result<DeviceQueueItem, Error> {
88 let qi: DeviceQueueItem =
89 diesel::update(device_queue_item::dsl::device_queue_item.find(&qi.id))
90 .set((
91 device_queue_item::is_pending.eq(&qi.is_pending),
92 device_queue_item::f_cnt_down.eq(&qi.f_cnt_down),
93 device_queue_item::timeout_after.eq(&qi.timeout_after),
94 ))
95 .get_result(&mut get_async_db_conn().await?)
96 .await
97 .map_err(|e| Error::from_diesel(e, qi.id.to_string()))?;
98 info!(id = %qi.id, dev_eui = %qi.dev_eui, "Device queue-item updated");
99 Ok(qi)
100}
101
102pub async fn delete_item(id: &Uuid) -> Result<(), Error> {
103 let ra =

Callers 5

test_queue_itemFunction · 0.85
test_get_max_f_cnt_downFunction · 0.85

Calls 4

setMethod · 0.80
to_stringMethod · 0.80
updateFunction · 0.70
get_async_db_connFunction · 0.70

Tested by 3

test_queue_itemFunction · 0.68
test_get_max_f_cnt_downFunction · 0.68