Skip to content

Commit

Permalink
Remove prints
Browse files Browse the repository at this point in the history
  • Loading branch information
marcua committed Jan 20, 2025
1 parent 559a588 commit 9d92c84
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
6 changes: 0 additions & 6 deletions src/hosted_db/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ pub async fn potentially_isolated_sqlite_query(
query_mode: QueryMode,
) -> Result<QueryResult, AybError> {
if let Some(isolation) = isolation {
println!("potentially1");
let result =
run_in_sandbox(Path::new(&isolation.nsjail_path), path, query, query_mode).await?;
println!("potentially2");
if !result.stderr.is_empty() {
let error: Result<AybError, _> = serde_json::from_str(&result.stderr);
// If the error could be deserialized into an AybError,
Expand All @@ -106,20 +104,16 @@ pub async fn potentially_isolated_sqlite_query(
}),
};
} else if result.status != 0 {
println!("potentially5");
return Err(AybError::QueryError {
message: format!(
"Error status from sandboxed query runner: {}",
result.status
),
});
} else if !result.stdout.is_empty() {
println!("potentially6");
let query_result: QueryResult = serde_json::from_str(&result.stdout)?;
println!("potentially7");
return Ok(query_result);
} else {
println!("potentially8");
return Err(AybError::QueryError {
message: "No results from sandboxed query runner".to_string(),
});
Expand Down
10 changes: 0 additions & 10 deletions src/server/endpoints/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,17 @@ async fn query(
ayb_config: web::Data<AybConfig>,
authenticated_entity: Option<web::ReqData<InstantiatedEntity>>,
) -> Result<web::Json<QueryResult>, AybError> {
println!("1");
let entity_slug = &path.entity.to_lowercase();
println!("2");
let database_slug = &path.database;
println!("3");
let database = ayb_db.get_database(entity_slug, database_slug).await?;
println!("4");
let authenticated_entity = unwrap_authenticated_entity(&authenticated_entity)?;
println!("5");

let access_level =
highest_query_access_level(&authenticated_entity, &database, &ayb_db).await?;
println!("6");
match access_level {
Some(access_level) => {
println!("7");
let db_type = DBType::try_from(database.db_type)?;
println!("8");
let db_path = current_database_path(entity_slug, database_slug, &ayb_config.data_path)?;
println!("9");
let result = run_query(
&db_path,
&query,
Expand All @@ -46,7 +37,6 @@ async fn query(
access_level,
)
.await?;
println!("10");
Ok(web::Json(result))
}
None => Err(AybError::Other {
Expand Down

0 comments on commit 9d92c84

Please sign in to comment.