fix migraiton

This commit is contained in:
Ruben Fiszel
2023-09-14 11:44:36 +02:00
parent 3792a2d7f3
commit c0284ea356
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -396,7 +396,7 @@ pub struct CompletedJob<'rows> {
pub created_by: String,
pub created_at: chrono::DateTime<chrono::Utc>,
pub started_at: chrono::DateTime<chrono::Utc>,
pub duration_ms: i32,
pub duration_ms: i64,
pub success: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub script_hash: Option<ScriptHash>,
@@ -453,7 +453,7 @@ pub struct ListableCompletedJob {
pub created_by: String,
pub created_at: chrono::DateTime<chrono::Utc>,
pub started_at: chrono::DateTime<chrono::Utc>,
pub duration_ms: i32,
pub duration_ms: i64,
pub success: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub script_hash: Option<ScriptHash>,
@@ -1348,7 +1348,7 @@ struct UnifiedJob {
running: Option<bool>,
script_hash: Option<ScriptHash>,
script_path: Option<String>,
duration_ms: Option<i32>,
duration_ms: Option<i64>,
success: Option<bool>,
deleted: bool,
canceled: bool,
+2 -2
View File
@@ -1026,8 +1026,8 @@ pub async fn pull<R: rsmq_async::RsmqConnection + Send + Clone>(
let job_uuid: Uuid = pulled_job.id;
let min_started_at: Option<DateTime<Utc>> = script_path_live_stats.min_started_at;
let avg_script_duration: Option<i32> = sqlx::query_scalar!(
"SELECT CAST(ROUND(AVG(duration_ms) / 1000, 0) AS INT) AS avg_duration_s FROM
let avg_script_duration: Option<i64> = sqlx::query_scalar!(
"SELECT CAST(ROUND(AVG(duration_ms) / 1000, 0) AS BIGINT) AS avg_duration_s FROM
(SELECT duration_ms FROM completed_job WHERE script_path = $1
ORDER BY started_at
DESC LIMIT 10) AS t",