formatting
Some checks failed
CI / Security Blocking Checks (push) Successful in 34s
CI / Web Blocking Checks (push) Failing after 1m44s
CI / Rust Blocking Checks (push) Failing after 9m57s
CI / Web Advisory Checks (push) Successful in 1m14s
CI / Security Advisory Checks (push) Successful in 1m28s

This commit is contained in:
2026-03-04 23:46:31 -06:00
parent 13749409cd
commit f54eef3a14
3 changed files with 73 additions and 68 deletions

View File

@@ -947,7 +947,9 @@ async fn register_pack_internal(
// where the API host has the interpreter available. // where the API host has the interpreter available.
if let Some(ref env_cfg) = exec_config.environment { if let Some(ref env_cfg) = exec_config.environment {
if env_cfg.env_type != "none" if env_cfg.env_type != "none"
&& !env_dir.exists() && !env_cfg.create_command.is_empty() { && !env_dir.exists()
&& !env_cfg.create_command.is_empty()
{
// Ensure parent directories exist // Ensure parent directories exist
if let Some(parent) = env_dir.parent() { if let Some(parent) = env_dir.parent() {
let _ = std::fs::create_dir_all(parent); let _ = std::fs::create_dir_all(parent);
@@ -982,8 +984,7 @@ async fn register_pack_internal(
); );
} }
Ok(output) => { Ok(output) => {
let stderr = let stderr = String::from_utf8_lossy(&output.stderr);
String::from_utf8_lossy(&output.stderr);
tracing::info!( tracing::info!(
"Environment creation skipped in API service (exit {}): {}. \ "Environment creation skipped in API service (exit {}): {}. \
The worker will create it on first execution.", The worker will create it on first execution.",

View File

@@ -180,8 +180,10 @@ impl ApiClient {
let req = self.attach_body(self.build_request(method.clone(), path), body); let req = self.attach_body(self.build_request(method.clone(), path), body);
let response = req.send().await.context("Failed to send request to API")?; let response = req.send().await.context("Failed to send request to API")?;
if response.status() == StatusCode::UNAUTHORIZED && self.refresh_token.is_some() if response.status() == StatusCode::UNAUTHORIZED
&& self.refresh_auth_token().await? { && self.refresh_token.is_some()
&& self.refresh_auth_token().await?
{
// Retry with new token // Retry with new token
let req = self.attach_body(self.build_request(method, path), body); let req = self.attach_body(self.build_request(method, path), body);
let response = req let response = req
@@ -204,8 +206,10 @@ impl ApiClient {
let req = self.attach_body(self.build_request(method.clone(), path), body); let req = self.attach_body(self.build_request(method.clone(), path), body);
let response = req.send().await.context("Failed to send request to API")?; let response = req.send().await.context("Failed to send request to API")?;
if response.status() == StatusCode::UNAUTHORIZED && self.refresh_token.is_some() if response.status() == StatusCode::UNAUTHORIZED
&& self.refresh_auth_token().await? { && self.refresh_token.is_some()
&& self.refresh_auth_token().await?
{
let req = self.attach_body(self.build_request(method, path), body); let req = self.attach_body(self.build_request(method, path), body);
let response = req let response = req
.send() .send()
@@ -391,8 +395,10 @@ impl ApiClient {
.await .await
.context("Failed to send multipart request to API")?; .context("Failed to send multipart request to API")?;
if response.status() == StatusCode::UNAUTHORIZED && self.refresh_token.is_some() if response.status() == StatusCode::UNAUTHORIZED
&& self.refresh_auth_token().await? { && self.refresh_token.is_some()
&& self.refresh_auth_token().await?
{
// Retry with new token // Retry with new token
let req = build_multipart_request(self, &file_bytes)?; let req = build_multipart_request(self, &file_bytes)?;
let response = req let response = req

View File

@@ -730,8 +730,7 @@ impl SensorInstance {
} }
/// Sensor status information /// Sensor status information
#[derive(Clone, Debug)] #[derive(Clone, Debug, Default)]
#[derive(Default)]
pub struct SensorStatus { pub struct SensorStatus {
/// Whether the sensor is running /// Whether the sensor is running
pub running: bool, pub running: bool,
@@ -746,7 +745,6 @@ pub struct SensorStatus {
pub last_poll: Option<chrono::DateTime<chrono::Utc>>, pub last_poll: Option<chrono::DateTime<chrono::Utc>>,
} }
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;