pub fn stop_workers(
    conn: &PgConnection,
    w_ids: &[i32],
    _logger: &Logger,
) -> Result<usize, MeshSimError> {
    use schema::worker_velocities::dsl::*;

    let rows = diesel::update(worker_velocities.filter(worker_id.eq_any(w_ids)))
        .set((x.eq(0.0), y.eq(0.0)))
        .execute(conn)
        .map_err(|e| {
            let error_msg = format!("Failed to stop workers {:?}", w_ids);
            MeshSimError {
                kind: MeshSimErrorKind::SQLExecutionFailure(error_msg),
                cause: Some(Box::new(e)),
            }
        })?;
    Ok(rows)
}
/// Function exported exclusively for the use of the Master module.
/// Sets the velocity of the worker ids to zero.
Function exported exclusively for the use of the Master module.
Sets the velocity of the worker ids to zero.
Function exported exclusively for the use of the Master module . Sets the velocity of the worker ids to zero .
pub fn stop_workers(
    conn: &PgConnection,
    w_ids: &[i32],
    _logger: &Logger,
) -> Result<usize, MeshSimError> {
    use schema::worker_velocities::dsl::*;
    let rows = diesel::update(worker_velocities.filter(worker_id.eq_any(w_ids)))
        .set((x.eq(0.0), y.eq(0.0)))
        .execute(conn)
        .map_err(|e| {
            let error_msg = format!("Failed to stop workers {:?}", w_ids);
            MeshSimError {
                kind: MeshSimErrorKind::SQLExecutionFailure(error_msg),
                cause: Some(Box::new(e)),
            }
        })?;
    Ok(rows)
}
pub fn stop_workers ( conn : & PgConnection , w_ids : & [ i32 ] , _logger : & Logger , ) -> Result < usize , MeshSimError > { use schema :: worker_velocities :: dsl :: * ; let rows = diesel :: update ( worker_velocities . filter ( worker_id . eq_any ( w_ids ) ) ) . set ( ( x . eq ( 0.0 ) , y . eq ( 0.0 ) ) ) . execute ( conn ) . map_err ( | e | { let error_msg = format ! ( " " w_ids ) ; MeshSimError { kind : MeshSimErrorKind :: SQLExecutionFailure ( error_msg ) , cause : Some ( Box :: new ( e ) ) , } } ) ? ; Ok ( rows ) }
Function exported exclusively for the use of the Master module.
Function exported exclusively for the use of the Master module .
conn
&PgConnection
w_ids
&[i32]
_logger
&Logger