Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/engine.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
use anyhow::{anyhow, Result};
use rust_embed::RustEmbed;
use std::string::String;
use std::{collections::HashSet, io::Cursor, path::PathBuf};
use wasi_common::{I32Exit, WasiCtx};
use wasmtime::{AsContextMut, Config, Engine, Linker, Module, ResourceLimiter, Store};

use crate::{
function_run_result::{
FunctionOutput::{self, InvalidJsonOutput, JsonOutput},
FunctionRunResult, InvalidOutput,
},
logs::LogStream,
use crate::function_run_result::{
FunctionOutput::{self, InvalidJsonOutput, JsonOutput},
FunctionRunResult, InvalidOutput,
};

#[derive(Clone)]
Expand Down Expand Up @@ -130,7 +128,7 @@ pub fn run(params: FunctionRunParams) -> Result<FunctionRunResult> {

let input_stream = wasi_common::pipe::ReadPipe::new(Cursor::new(input.clone()));
let output_stream = wasi_common::pipe::WritePipe::new_in_memory();
let error_stream = wasi_common::pipe::WritePipe::new(LogStream::default());
let error_stream = wasi_common::pipe::WritePipe::new_in_memory();

let memory_usage: u64;
let instructions: u64;
Expand Down Expand Up @@ -195,9 +193,10 @@ pub fn run(params: FunctionRunParams) -> Result<FunctionRunResult> {

let mut logs = error_stream
.try_into_inner()
.expect("Log stream reference still exists");
.expect("Log stream reference still exists")
.into_inner();

logs.append(error_logs.as_bytes());
logs.extend_from_slice(error_logs.as_bytes());

let raw_output = output_stream
.try_into_inner()
Expand Down Expand Up @@ -228,7 +227,7 @@ pub fn run(params: FunctionRunParams) -> Result<FunctionRunResult> {
size,
memory_usage,
instructions,
logs: logs.to_string(),
logs: String::from_utf8_lossy(&logs).into(),
input: function_run_input,
output,
profile: profile_data,
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod bluejay_schema_analyzer;
pub mod engine;
pub mod function_run_result;
pub mod logs;
pub mod scale_limits_analyzer;
88 changes: 0 additions & 88 deletions src/logs.rs

This file was deleted.