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
21 changes: 12 additions & 9 deletions app/src/infinite_hashes/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,15 @@ def wrapped(*args, **kwargs):
"expires": datetime.timedelta(minutes=1).total_seconds(),
},
},
# Luxor hashrate scraper
"scrape_luxor": {
"task": "infinite_hashes.validator.tasks.scrape_luxor",
"schedule": datetime.timedelta(seconds=20),
"options": {
"expires": datetime.timedelta(seconds=40).total_seconds(),
},
},
# Disabled temporarily: Luxor scraping is turned off for now, but we are
# keeping the implementation in place so it can be restored quickly if needed.
# "scrape_luxor": {
# "task": "infinite_hashes.validator.tasks.scrape_luxor",
# "schedule": datetime.timedelta(seconds=20),
# "options": {
# "expires": datetime.timedelta(seconds=40).total_seconds(),
# },
# },
"cleanup_old_luxor_snapshots": {
"task": "infinite_hashes.validator.tasks.cleanup_old_luxor_snapshots",
"schedule": datetime.timedelta(hours=1),
Expand All @@ -362,7 +363,9 @@ def wrapped(*args, **kwargs):
CELERY_TASK_DEFAULT_ROUTING_KEY = "default"
CELERY_TASK_DEFAULT_RATE_LIMIT = "1/s"
CELERY_TASK_ROUTES = {
"infinite_hashes.validator.tasks.scrape_luxor": {"queue": "luxor"},
# Disabled temporarily: Luxor scraping is turned off for now, but we are
# keeping the implementation in place so it can be restored quickly if needed.
# "infinite_hashes.validator.tasks.scrape_luxor": {"queue": "luxor"},
"infinite_hashes.validator.tasks.cleanup_old_luxor_snapshots": {"queue": "luxor"},
"infinite_hashes.validator.tasks.calculate_weights": {"queue": "weights"},
"infinite_hashes.validator.tasks.set_weights": {"queue": "weights"},
Expand Down
3 changes: 3 additions & 0 deletions app/src/infinite_hashes/validator/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,9 @@ def parse_last_updated(value: Any) -> datetime.datetime | None:
raise


# Luxor scraping is currently disabled in Celery beat/routing, but we are
# keeping this task implementation in place temporarily so it can be restored
# quickly if needed.
@app.task(autoretry_for=(httpx.HTTPStatusError,))
def scrape_luxor(subaccount_name: str | None = None) -> int:
"""Celery task to scrape Luxor hashrate data."""
Expand Down
Loading