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

Function enqueue_item

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

Source from the content-addressed store, hash-verified

64}
65
66pub async fn enqueue_item(qi: DeviceQueueItem) -> Result<DeviceQueueItem, Error> {
67 qi.validate()?;
68
69 let qi: DeviceQueueItem = diesel::insert_into(device_queue_item::table)
70 .values(&qi)
71 .get_result(&mut get_async_db_conn().await?)
72 .await
73 .map_err(|e| Error::from_diesel(e, qi.id.to_string()))?;
74 info!(id = %qi.id, dev_eui = %qi.dev_eui, "Device queue-item enqueued");
75 Ok(qi)
76}
77
78pub async fn get_item(id: &Uuid) -> Result<DeviceQueueItem, Error> {
79 let qi = device_queue_item::dsl::device_queue_item

Callers 15

handle_down_commandFunction · 0.85
test_queue_itemFunction · 0.85
test_flush_queueFunction · 0.85
test_get_max_f_cnt_downFunction · 0.85
run_testFunction · 0.85
run_scheduler_testFunction · 0.85
test_sns_uplinkFunction · 0.85
test_class_bFunction · 0.85
run_uplink_testFunction · 0.85

Calls 3

to_stringMethod · 0.80
get_async_db_connFunction · 0.70
validateMethod · 0.45

Tested by 13

test_queue_itemFunction · 0.68
test_flush_queueFunction · 0.68
test_get_max_f_cnt_downFunction · 0.68
run_testFunction · 0.68
run_scheduler_testFunction · 0.68
test_sns_uplinkFunction · 0.68
test_class_bFunction · 0.68
run_uplink_testFunction · 0.68
run_scheduler_testFunction · 0.68