From 3792a2d7f3c54dfd99e6748e20f7ce816725a7dc Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 14 Sep 2023 11:32:52 +0200 Subject: [PATCH] fix migration --- backend/Cargo.lock | 1 + backend/Cargo.toml | 1 + backend/windmill-queue/Cargo.toml | 1 + backend/windmill-queue/src/jobs.rs | 8 +++++--- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index cc014badd9..b5ba5aa58b 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -7356,6 +7356,7 @@ version = "1.172.1" dependencies = [ "anyhow", "async-recursion", + "bigdecimal", "chrono", "chrono-tz", "cron", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 0fc68e388e..3b94c3f4df 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -157,6 +157,7 @@ sqlx = { version = "^0", features = [ "runtime-tokio-rustls", "bigdecimal" ] } +bigdecimal = "^0" dotenv = "^0" ulid = { version = "^1", features = ["uuid"] } futures = "^0" diff --git a/backend/windmill-queue/Cargo.toml b/backend/windmill-queue/Cargo.toml index 36c6a94fbd..12b3ff2140 100644 --- a/backend/windmill-queue/Cargo.toml +++ b/backend/windmill-queue/Cargo.toml @@ -37,3 +37,4 @@ tokio.workspace = true futures-core.workspace = true itertools.workspace = true async-recursion.workspace = true +bigdecimal.workspace = true \ No newline at end of file diff --git a/backend/windmill-queue/src/jobs.rs b/backend/windmill-queue/src/jobs.rs index e3b46336e4..64a752ef47 100644 --- a/backend/windmill-queue/src/jobs.rs +++ b/backend/windmill-queue/src/jobs.rs @@ -8,16 +8,16 @@ use std::{collections::HashMap, sync::atomic::AtomicBool, vec}; -#[cfg(feature = "benchmark")] -use std::time::Instant; - use anyhow::Context; use async_recursion::async_recursion; +use bigdecimal::ToPrimitive; use chrono::{DateTime, Duration, Utc}; use reqwest::Client; use rsmq_async::RsmqConnection; use serde_json::json; use sqlx::{Pool, Postgres, Transaction}; +#[cfg(feature = "benchmark")] +use std::time::Instant; use tracing::{instrument, Instrument}; use ulid::Ulid; use uuid::Uuid; @@ -236,6 +236,8 @@ pub async fn add_completed_job( .await .ok() .flatten() + .map(|x| x.to_i64()) + .flatten() } else { tracing::warn!("Could not parse flow status"); None