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

Function update_deployment

chirpstack/src/storage/fuota.rs:217–255  ·  view source on GitHub ↗
(d: FuotaDeployment)

Source from the content-addressed store, hash-verified

215}
216
217pub async fn update_deployment(d: FuotaDeployment) -> Result<FuotaDeployment, Error> {
218 d.validate()?;
219
220 let d: FuotaDeployment = diesel::update(fuota_deployment::dsl::fuota_deployment.find(&d.id))
221 .set((
222 fuota_deployment::updated_at.eq(&Utc::now()),
223 fuota_deployment::started_at.eq(&d.started_at),
224 fuota_deployment::completed_at.eq(&d.completed_at),
225 fuota_deployment::name.eq(&d.name),
226 fuota_deployment::multicast_group_type.eq(&d.multicast_group_type),
227 fuota_deployment::multicast_class_c_scheduling_type
228 .eq(&d.multicast_class_c_scheduling_type),
229 fuota_deployment::multicast_dr.eq(&d.multicast_dr),
230 fuota_deployment::multicast_class_b_ping_slot_periodicity
231 .eq(&d.multicast_class_b_ping_slot_periodicity),
232 fuota_deployment::multicast_frequency.eq(&d.multicast_frequency),
233 fuota_deployment::multicast_timeout.eq(&d.multicast_timeout),
234 fuota_deployment::multicast_session_start.eq(&d.multicast_session_start),
235 fuota_deployment::multicast_session_end.eq(&d.multicast_session_end),
236 fuota_deployment::unicast_max_retry_count.eq(&d.unicast_max_retry_count),
237 fuota_deployment::fragmentation_fragment_size.eq(&d.fragmentation_fragment_size),
238 fuota_deployment::fragmentation_redundancy_percentage
239 .eq(&d.fragmentation_redundancy_percentage),
240 fuota_deployment::fragmentation_session_index.eq(&d.fragmentation_session_index),
241 fuota_deployment::fragmentation_matrix.eq(&d.fragmentation_matrix),
242 fuota_deployment::fragmentation_block_ack_delay.eq(&d.fragmentation_block_ack_delay),
243 fuota_deployment::fragmentation_descriptor.eq(&d.fragmentation_descriptor),
244 fuota_deployment::request_fragmentation_session_status
245 .eq(&d.request_fragmentation_session_status),
246 fuota_deployment::payload.eq(&d.payload),
247 fuota_deployment::on_complete_set_device_tags.eq(&d.on_complete_set_device_tags),
248 ))
249 .get_result(&mut get_async_db_conn().await?)
250 .await
251 .map_err(|e| Error::from_diesel(e, d.id.to_string()))?;
252
253 info!(id = %d.id, "FUOTA deployment updated");
254 Ok(d)
255}
256
257pub async fn delete_deployment(id: Uuid) -> Result<(), Error> {
258 let ra = diesel::delete(fuota_deployment::dsl::fuota_deployment.find(&fields::Uuid::from(id)))

Callers 5

test_fuotaFunction · 0.85
update_deploymentMethod · 0.85
start_deploymentMethod · 0.85
completeMethod · 0.85

Calls 5

setMethod · 0.80
to_stringMethod · 0.80
updateFunction · 0.70
get_async_db_connFunction · 0.70
validateMethod · 0.45

Tested by 1

test_fuotaFunction · 0.68