From e7b25bfe1dcc6d745823bbb431b211e3607c8062 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 8 Jun 2024 16:34:40 +0200 Subject: [PATCH] fix: distinct doesnt work because published... it differs by few microseconds but it still differs so duplicates --- upub/core/src/traits/address.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/upub/core/src/traits/address.rs b/upub/core/src/traits/address.rs index 4ffdab30..53eaa186 100644 --- a/upub/core/src/traits/address.rs +++ b/upub/core/src/traits/address.rs @@ -68,6 +68,7 @@ impl Addresser for crate::Context { async fn address_to(ctx: &crate::Context, to: Vec, aid: Option, oid: Option, local: bool, tx: &impl ConnectionTrait) -> Result<(), DbErr> { // TODO address_to became kind of expensive, with these two selects right away and then another // select for each target we're addressing to... can this be improved?? + let now = chrono::Utc::now(); let mut addressing = Vec::new(); for target in to.into_iter() .filter(|to| !to.is_empty()) @@ -91,7 +92,7 @@ async fn address_to(ctx: &crate::Context, to: Vec, aid: Option, oid actor: Set(actor), activity: Set(aid), object: Set(oid), - published: Set(chrono::Utc::now()), + published: Set(now), } ); }