From d5c9bbe38e31029dce398b53ae52c3868fc0a75b Mon Sep 17 00:00:00 2001 From: brotoskyj Date: Thu, 6 Nov 2025 10:35:21 -0500 Subject: [PATCH] Minor Memory Optimization in Airlock Libs --- .gitignore | 1 + airlock_libs/Cargo.lock | 2 +- airlock_libs/Cargo.toml | 2 +- airlock_libs/pyproject.toml | 2 +- airlock_libs/src/services.rs | 2 +- requirements.txt | 5 ++++- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index d9b2b2a..056024d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.toml !airlock_libs/Cargo.toml !airlock_libs/pyproject.toml .env diff --git a/airlock_libs/Cargo.lock b/airlock_libs/Cargo.lock index b63511b..70327a0 100644 --- a/airlock_libs/Cargo.lock +++ b/airlock_libs/Cargo.lock @@ -17,7 +17,7 @@ dependencies = [ [[package]] name = "airlock_libs" -version = "1.0.2" +version = "1.0.3" dependencies = [ "chrono", "indicatif", diff --git a/airlock_libs/Cargo.toml b/airlock_libs/Cargo.toml index 907432e..15f8786 100644 --- a/airlock_libs/Cargo.toml +++ b/airlock_libs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "airlock_libs" -version = "1.0.2" +version = "1.0.3" edition = "2024" [lib] diff --git a/airlock_libs/pyproject.toml b/airlock_libs/pyproject.toml index 2251ec9..2f78abd 100644 --- a/airlock_libs/pyproject.toml +++ b/airlock_libs/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "airlock_libs" -version = "1.0.2" +version = "1.0.3" description = "Airlock Digital API Wrapper" readme = "README.md" license = { text = "AGPL-3.0-only" } diff --git a/airlock_libs/src/services.rs b/airlock_libs/src/services.rs index bb7b11e..5056344 100644 --- a/airlock_libs/src/services.rs +++ b/airlock_libs/src/services.rs @@ -95,6 +95,7 @@ pub fn pull_policy_exec_histories( progress_bar.enable_steady_tick(std::time::Duration::from_millis(100)); let client = build_client(py, &py_self); let api: Py = py_self; + let cutoff = Local::now().naive_local() - Duration::days(days); loop { let execution_histories = history_logging( py, @@ -152,7 +153,6 @@ pub fn pull_policy_exec_histories( Ok(date) => date, Err(_) => continue, }; - let cutoff = Local::now().naive_local() - Duration::days(days); if history_date >= cutoff.into() { let key = ( executions.sha256.clone(), diff --git a/requirements.txt b/requirements.txt index bb00042..e932ee2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,7 @@ requests==2.32.5 schedule==1.2.2 tqdm==4.67.1 urllib3==2.5.0 -bson==0.5.10 \ No newline at end of file +bson==0.5.10 + +--extra-index-url https://git.racooncity.org/api/packages/brotoskyj/pypi/simple/ +airlock_libs==1.0.3 \ No newline at end of file