You've already forked AstralRinth
forked from didirus/AstralRinth
Link customer ID to Anrok transaction (#4509)
* Mark transactions with unresolvable addresses as unresolved * Add customer_name + customer_id to anrok transactions * Increase rate of Anrok syn * Remove timer from update_tax_transactions * chore: query cache, clippy, fmt
This commit is contained in:
committed by
GitHub
parent
dbc64afe48
commit
9589e23118
@@ -89,7 +89,7 @@ impl TryFrom<ChargeQueryResult> for DBCharge {
|
||||
}
|
||||
|
||||
macro_rules! select_charges_with_predicate {
|
||||
($predicate:tt, $param:ident) => {
|
||||
($predicate:tt $(, $( $param0:expr $(, $param:expr)* $(,)? )?)?) => {
|
||||
sqlx::query_as!(
|
||||
ChargeQueryResult,
|
||||
r#"
|
||||
@@ -107,7 +107,7 @@ macro_rules! select_charges_with_predicate {
|
||||
FROM charges
|
||||
"#
|
||||
+ $predicate,
|
||||
$param
|
||||
$( $( $param0, $( $param ),* )? )?
|
||||
)
|
||||
};
|
||||
}
|
||||
@@ -344,6 +344,7 @@ impl DBCharge {
|
||||
/// Charges are locked.
|
||||
pub async fn get_missing_tax_identifier_lock(
|
||||
exec: impl sqlx::Executor<'_, Database = sqlx::Postgres>,
|
||||
offset: i64,
|
||||
limit: i64,
|
||||
) -> Result<Vec<DBCharge>, DatabaseError> {
|
||||
let res = select_charges_with_predicate!(
|
||||
@@ -354,8 +355,10 @@ impl DBCharge {
|
||||
AND payment_platform_id IS NOT NULL
|
||||
ORDER BY due ASC
|
||||
FOR NO KEY UPDATE SKIP LOCKED
|
||||
LIMIT $1
|
||||
OFFSET $1
|
||||
LIMIT $2
|
||||
",
|
||||
offset,
|
||||
limit
|
||||
)
|
||||
.fetch_all(exec)
|
||||
|
||||
Reference in New Issue
Block a user