-
Notifications
You must be signed in to change notification settings - Fork 0
Airdrop cron job service in rust #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
scripts/airdrop/src/main.rs
Outdated
| for sub in subscriptions { | ||
| if let Some(wallet) = db::wallet.find_first(sub.user.id).await? { |
There was a problem hiding this comment.
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.
scripts/airdrop/src/client.rs
Outdated
| 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 |
There was a problem hiding this comment.
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.
No description provided.