Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptobench committed Sep 25, 2024
1 parent 269fc37 commit ed06109
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 2 additions & 0 deletions stats-backend/api2/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@


def calculate_uptime_percentage(node_id, node=None):
if node is None:
node = Node.objects.get(node_id=node_id)
statuses = NodeStatusHistory.objects.filter(node_id=node_id).order_by("timestamp")

online_duration = timedelta(0)
Expand Down
1 change: 1 addition & 0 deletions stats-backend/api2/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1911,6 +1911,7 @@ def fetch_and_update_relay_nodes_online_status():
missing_nodes = previously_online - current_online_nodes
if missing_nodes:
check_missing_nodes.delay(list(missing_nodes))
fetch_and_store_relay_nodes.apply_async(countdown=15)


@app.task
Expand Down
7 changes: 1 addition & 6 deletions stats-backend/core/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,7 @@ def setup_periodic_tasks(sender, **kwargs):
extract_wallets_and_ids,
fetch_and_update_relay_nodes_online_status,
)
sender.add_periodic_task(
30.0,
fetch_and_update_relay_nodes_online_status.s(),
queue="default",
options={"queue": "default", "routing_key": "default"},
)
fetch_and_store_relay_nodes.delay()
sender.add_periodic_task(
60,
computing_total_over_time.s(),
Expand Down

0 comments on commit ed06109

Please sign in to comment.