diff --git a/examples/engine.rs b/examples/engine.rs index 11bfd56..6aaeccd 100644 --- a/examples/engine.rs +++ b/examples/engine.rs @@ -4,7 +4,6 @@ use std::panic; use std::path::Path; use rhai::{Engine, Dynamic}; -use runner_rust::AsyncRunner; /// Recursively collect all .rhai files from a directory and its subdirectories fn collect_rhai_files(dir: &Path, files: &mut Vec) -> Result<(), Box> { diff --git a/src/bin/runner_sal/engine.rs b/src/bin/runner_sal/engine.rs index 7f00afc..c902791 100644 --- a/src/bin/runner_sal/engine.rs +++ b/src/bin/runner_sal/engine.rs @@ -1,75 +1,16 @@ use std::sync::{Arc, OnceLock}; // Re-export common Rhai types for convenience -pub use rhai::{Array, Dynamic, Engine, EvalAltResult, Map}; +pub use rhai::Engine; // Re-export specific functions from sal-os package -pub use sal_os::rhai::{ - delete, - // Download functions - download, - download_install, - // File system functions - exist, - file_size, - find_dir, - find_dirs, - find_file, - find_files, - mkdir, - register_os_module, - rsync, -}; // Re-export Redis client module registration function -pub use sal_redisclient::rhai::register_redisclient_module; // Re-export PostgreSQL client module registration function -pub use sal_postgresclient::rhai::register_postgresclient_module; -pub use sal_process::rhai::{ - kill, - process_get, - process_list, - register_process_module, - // Run functions - // Process management functions - which, -}; // Re-export virt functions from sal-virt package -pub use sal_virt::rhai::nerdctl::{ - nerdctl_copy, - nerdctl_exec, - nerdctl_image_build, - nerdctl_image_commit, - nerdctl_image_pull, - nerdctl_image_push, - nerdctl_image_remove, - nerdctl_image_tag, - // Image functions - nerdctl_images, - nerdctl_list, - nerdctl_remove, - // Container functions - nerdctl_run, - nerdctl_run_with_name, - nerdctl_run_with_port, - nerdctl_stop, -}; -pub use sal_virt::rhai::{ - bah_new, register_bah_module, register_nerdctl_module, register_rfs_module, -}; -pub use sal_git::rhai::register_git_module; -pub use sal_git::{GitRepo, GitTree}; -pub use sal_zinit_client::rhai::register_zinit_module; -pub use sal_mycelium::rhai::register_mycelium_module; -pub use sal_text::rhai::register_text_module; -pub use sal_net::rhai::register_net_module; -pub use sal_kubernetes::rhai::register_kubernetes_module; -pub use sal_kubernetes::KubernetesManager; -pub use sal_os::rhai::copy as os_copy; -pub use sal_hetzner::rhai::register_hetzner_module; /// Engine factory for creating and sharing Rhai engines with SAL modules. pub struct EngineFactory { diff --git a/src/job.rs b/src/job.rs index fa551f3..6cd807c 100644 --- a/src/job.rs +++ b/src/job.rs @@ -1,5 +1,4 @@ use chrono::{Utc}; -use redis::AsyncCommands; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use thiserror::Error; diff --git a/src/lib.rs b/src/lib.rs index 432975a..87b676a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,7 +17,7 @@ pub use engine::osis::{register_dsl_modules, create_osis_engine, create_shared_o // Re-export job types from local job module pub use job::{Job, JobStatus, JobError, JobBuilder, Client}; pub use redis::AsyncCommands; -use log::{debug, error, info}; +use log::{error, info}; const BLPOP_TIMEOUT_SECONDS: usize = 5; diff --git a/src/script_mode.rs b/src/script_mode.rs index f8d9813..3eb50c8 100644 --- a/src/script_mode.rs +++ b/src/script_mode.rs @@ -1,5 +1,5 @@ use std::time::Duration; -use tokio::time::{timeout, sleep}; +use tokio::time::timeout; use crate::job::{JobBuilder, Client, JobStatus}; use log::{info, error}; use tokio::sync::mpsc;