mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
chore: Add tracing for debuging the js procedure slowness (#1552)
* chore: Add tracing for debuging the js procedure slowness * chore: Make the display to reduce vertical clutter
This commit is contained in:
@@ -64,6 +64,7 @@ impl PackageProcedure {
|
|||||||
allow_inject: bool,
|
allow_inject: bool,
|
||||||
timeout: Option<Duration>,
|
timeout: Option<Duration>,
|
||||||
) -> Result<Result<O, (i32, String)>, Error> {
|
) -> Result<Result<O, (i32, String)>, Error> {
|
||||||
|
tracing::trace!("Procedure execute {} {} - {:?}", self, pkg_id, name);
|
||||||
match self {
|
match self {
|
||||||
PackageProcedure::Docker(procedure) => {
|
PackageProcedure::Docker(procedure) => {
|
||||||
procedure
|
procedure
|
||||||
@@ -106,6 +107,7 @@ impl PackageProcedure {
|
|||||||
timeout: Option<Duration>,
|
timeout: Option<Duration>,
|
||||||
name: ProcedureName,
|
name: ProcedureName,
|
||||||
) -> Result<Result<O, (i32, String)>, Error> {
|
) -> Result<Result<O, (i32, String)>, Error> {
|
||||||
|
tracing::trace!("Procedure sandboxed {} {} - {:?}", self, pkg_id, name);
|
||||||
match self {
|
match self {
|
||||||
PackageProcedure::Docker(procedure) => {
|
PackageProcedure::Docker(procedure) => {
|
||||||
procedure
|
procedure
|
||||||
@@ -122,6 +124,15 @@ impl PackageProcedure {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Display for PackageProcedure {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
match self {
|
||||||
|
PackageProcedure::Docker(_) => write!(f, "Docker")?,
|
||||||
|
PackageProcedure::Script(_) => write!(f, "JS")?,
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct NoOutput;
|
pub struct NoOutput;
|
||||||
impl<'de> Deserialize<'de> for NoOutput {
|
impl<'de> Deserialize<'de> for NoOutput {
|
||||||
|
|||||||
Reference in New Issue
Block a user