Skip to content

Commit

Permalink
Auto merge of #615 - Mark-Simulacrum:opt, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Cache prepared SQL statements; delete outdated configuration endpoint

See commits for details.
  • Loading branch information
bors committed Mar 8, 2022
2 parents a14dda6 + 51d7e34 commit ff1a8d8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub trait QueryUtils {
fn execute(&self, sql: &str, params: &[&dyn ToSql]) -> Fallible<usize> {
self.with_conn(|conn| {
self.trace(sql, || {
let mut prepared = conn.prepare(sql)?;
let mut prepared = conn.prepare_cached(sql)?;
let changes = prepared.execute(params)?;
Ok(changes)
})
Expand Down
10 changes: 0 additions & 10 deletions src/server/routes/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ pub fn routes(
.and(auth_filter(data.clone(), TokenType::Agent))
.map(endpoint_config);

// Assume agents that do not POST their capabilities to `/config` are Linux agents.
let config_old = warp::get2()
.and(warp::path("config"))
.and(warp::path::end())
.and(data_filter.clone())
.and(auth_filter(data.clone(), TokenType::Agent))
.map(|data, auth| endpoint_config(Capabilities::new(&["linux"]), data, auth));

let next_experiment = warp::get2()
.and(warp::path("next-experiment"))
.and(warp::path::end())
Expand Down Expand Up @@ -81,8 +73,6 @@ pub fn routes(
warp::any()
.and(
config
.or(config_old)
.unify()
.or(next_experiment)
.unify()
.or(record_progress)
Expand Down

0 comments on commit ff1a8d8

Please sign in to comment.