-
Notifications
You must be signed in to change notification settings - Fork 111
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
[PAY-2178] Initial implementation of payment router indexing #6892
Changes from 5 commits
af53bed
10c95da
6b57f6f
be2045d
17c6d3c
943db0f
609c667
0087933
b4bc778
12a0ad1
71eeb6d
4995137
e240b79
0bb48d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
begin; | ||
|
||
CREATE TABLE IF NOT EXISTS payment_router_txs ( | ||
signature character varying NOT NULL, | ||
slot integer NOT NULL, | ||
created_at timestamp without time zone NOT NULL | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS idx_payment_router_txs_slot ON payment_router_txs USING btree (slot); | ||
|
||
commit; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,6 +308,7 @@ def configure_celery(celery, test_config=None): | |
"src.tasks.index_solana_plays", | ||
"src.tasks.index_challenges", | ||
"src.tasks.index_user_bank", | ||
"src.tasks.index_payment_router", | ||
"src.tasks.index_eth", | ||
"src.tasks.index_oracles", | ||
"src.tasks.index_rewards_manager", | ||
|
@@ -370,6 +371,10 @@ def configure_celery(celery, test_config=None): | |
"task": "index_user_bank", | ||
"schedule": timedelta(seconds=5), | ||
}, | ||
"index_payment_router": { | ||
"task": "index_payment_router", | ||
"schedule": timedelta(seconds=5), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually don't recall the original reason for 5s interrupts in these on solana, but might improve our overall indexing speed if we lower it... (not this PR) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Worth a test! I would imagine the volume being processed on prod is much higher so maybe we don't want to get overwhelmed? But as it was, I was seeing up to 10 seconds locally for the transaction to be picked up. |
||
}, | ||
"index_challenges": { | ||
"task": "index_challenges", | ||
"schedule": timedelta(seconds=5), | ||
|
@@ -481,6 +486,7 @@ def configure_celery(celery, test_config=None): | |
redis_inst.delete("solana_plays_lock") | ||
redis_inst.delete("index_challenges_lock") | ||
redis_inst.delete("user_bank_lock") | ||
redis_inst.delete("payment_router_lock") | ||
redis_inst.delete("index_eth_lock") | ||
redis_inst.delete("index_oracles_lock") | ||
redis_inst.delete("solana_rewards_manager_lock") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from sqlalchemy import Column, DateTime, Integer, String | ||
|
||
from src.models.base import Base | ||
from src.models.model_utils import RepresentableMixin | ||
|
||
|
||
class PaymentRouterTx(Base, RepresentableMixin): | ||
__tablename__ = "payment_router_txs" | ||
|
||
signature = Column(String, primary_key=True) | ||
slot = Column(Integer, nullable=False, index=True) | ||
created_at = Column(DateTime, nullable=False) |
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.
by the way 0041 is already in main. you'll have to update this file name
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.
ooo good catch thank you!