Skip to content

Conversation

@alchemistgo87
Copy link
Contributor

No description provided.

Comment on lines 159 to 160
for sub in subscriptions {
if let Some(wallet) = db::wallet.find_first(sub.user.id).await? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should do an inner join on subscriptions and wallets so don't need the additional check can just loop through and airdrop.

Comment on lines 4 to 10
lazy_static! {
static ref PRISMA_CLIENT: Mutex<PrismaClient> = Mutex::new(PrismaClient::new());
}

pub fn get_prisma_client() -> &'static PrismaClient {
PRISMA_CLIENT.lock().unwrap()
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting. What is going on here? I think simplest would be to use sqlx and just write raw sql for this.

@mpwsh mpwsh marked this pull request as ready for review July 4, 2023 01:03
@mpwsh mpwsh merged commit 1c864af into main Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants