From ce3b024fea0d0d6535eea30737d883f2d8c35e91 Mon Sep 17 00:00:00 2001
From: Geometrically <18202329+Geometrically@users.noreply.github.com>
Date: Mon, 5 Feb 2024 12:02:07 -0700
Subject: [PATCH] Fix gift cards (#877)
* Fix gift card cashout
* Fix mutex locks
---
src/queue/payouts.rs | 24 ++++++++++--------------
src/routes/v3/payouts.rs | 11 +++--------
2 files changed, 13 insertions(+), 22 deletions(-)
diff --git a/src/queue/payouts.rs b/src/queue/payouts.rs
index fe341616..d16988a9 100644
--- a/src/queue/payouts.rs
+++ b/src/queue/payouts.rs
@@ -1,4 +1,3 @@
-use crate::models::ids::UserId;
use crate::models::payouts::{
PayoutDecimal, PayoutInterval, PayoutMethod, PayoutMethodFee, PayoutMethodType,
};
@@ -7,7 +6,6 @@ use crate::util::env::parse_var;
use crate::{database::redis::RedisPool, models::projects::MonetizationStatus};
use base64::Engine;
use chrono::{DateTime, Datelike, Duration, Utc, Weekday};
-use dashmap::DashMap;
use reqwest::Method;
use rust_decimal::Decimal;
use serde::de::DeserializeOwned;
@@ -16,13 +14,12 @@ use serde_json::Value;
use sqlx::postgres::PgQueryResult;
use sqlx::PgPool;
use std::collections::HashMap;
-use std::sync::Arc;
use tokio::sync::{Mutex, RwLock};
pub struct PayoutsQueue {
credential: RwLock