Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/labrinth/src/database/models/notification_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl NotificationBuilder {
'amount', to_jsonb(sum)
) body
FROM period_payouts
WHERE sum > 0
WHERE sum >= 100
",
&notification_ids[..],
&users_raw_ids[..],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,18 @@ impl PayoutsValuesNotification {

pub async fn synchronize_future_payout_values(
exec: impl sqlx::PgExecutor<'_>,
limit: i64,
) -> Result<(), DatabaseError> {
sqlx::query!(
"
INSERT INTO payouts_values_notifications (date_available, user_id, notified)
SELECT DISTINCT date_available, user_id, false notified
FROM payouts_values
WHERE date_available > NOW()
LIMIT $1
ON CONFLICT (date_available, user_id) DO NOTHING
",
limit,
)
.execute(exec)
.await?;
Expand Down
2 changes: 1 addition & 1 deletion apps/labrinth/src/queue/email/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ async fn collect_template_variables(

map.insert(
PAYOUTAVAILABLE_AMOUNT,
format!("USD${:.2}", *amount as f64 / 100.0),
format!("${:.2} USD", *amount as f64 / 100.0),
);

Ok(EmailTemplate::Static(map))
Expand Down
1 change: 1 addition & 0 deletions apps/labrinth/src/queue/payouts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,7 @@ pub async fn index_payouts_notifications(

payouts_values_notifications::synchronize_future_payout_values(
&mut *transaction,
200,
)
.await?;
let items = payouts_values_notifications::PayoutsValuesNotification::unnotified_users_with_available_payouts_with_limit(&mut *transaction, 200).await?;
Expand Down