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
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:
@@ -947,7 +947,9 @@ async fn register_pack_internal(
|
||||
// where the API host has the interpreter available.
|
||||
if let Some(ref env_cfg) = exec_config.environment {
|
||||
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
|
||||
if let Some(parent) = env_dir.parent() {
|
||||
let _ = std::fs::create_dir_all(parent);
|
||||
@@ -982,8 +984,7 @@ async fn register_pack_internal(
|
||||
);
|
||||
}
|
||||
Ok(output) => {
|
||||
let stderr =
|
||||
String::from_utf8_lossy(&output.stderr);
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
tracing::info!(
|
||||
"Environment creation skipped in API service (exit {}): {}. \
|
||||
The worker will create it on first execution.",
|
||||
|
||||
@@ -180,8 +180,10 @@ impl ApiClient {
|
||||
let req = self.attach_body(self.build_request(method.clone(), path), body);
|
||||
let response = req.send().await.context("Failed to send request to API")?;
|
||||
|
||||
if response.status() == StatusCode::UNAUTHORIZED && self.refresh_token.is_some()
|
||||
&& self.refresh_auth_token().await? {
|
||||
if response.status() == StatusCode::UNAUTHORIZED
|
||||
&& self.refresh_token.is_some()
|
||||
&& self.refresh_auth_token().await?
|
||||
{
|
||||
// Retry with new token
|
||||
let req = self.attach_body(self.build_request(method, path), body);
|
||||
let response = req
|
||||
@@ -204,8 +206,10 @@ impl ApiClient {
|
||||
let req = self.attach_body(self.build_request(method.clone(), path), body);
|
||||
let response = req.send().await.context("Failed to send request to API")?;
|
||||
|
||||
if response.status() == StatusCode::UNAUTHORIZED && self.refresh_token.is_some()
|
||||
&& self.refresh_auth_token().await? {
|
||||
if response.status() == StatusCode::UNAUTHORIZED
|
||||
&& self.refresh_token.is_some()
|
||||
&& self.refresh_auth_token().await?
|
||||
{
|
||||
let req = self.attach_body(self.build_request(method, path), body);
|
||||
let response = req
|
||||
.send()
|
||||
@@ -391,8 +395,10 @@ impl ApiClient {
|
||||
.await
|
||||
.context("Failed to send multipart request to API")?;
|
||||
|
||||
if response.status() == StatusCode::UNAUTHORIZED && self.refresh_token.is_some()
|
||||
&& self.refresh_auth_token().await? {
|
||||
if response.status() == StatusCode::UNAUTHORIZED
|
||||
&& self.refresh_token.is_some()
|
||||
&& self.refresh_auth_token().await?
|
||||
{
|
||||
// Retry with new token
|
||||
let req = build_multipart_request(self, &file_bytes)?;
|
||||
let response = req
|
||||
|
||||
@@ -730,8 +730,7 @@ impl SensorInstance {
|
||||
}
|
||||
|
||||
/// Sensor status information
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Default)]
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct SensorStatus {
|
||||
/// Whether the sensor is running
|
||||
pub running: bool,
|
||||
@@ -746,7 +745,6 @@ pub struct SensorStatus {
|
||||
pub last_poll: Option<chrono::DateTime<chrono::Utc>>,
|
||||
}
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user