mirror of
https://github.com/Retropex/custom-ocean.xyz-dashboard.git
synced 2025-05-13 03:30:46 +02:00
Update worker_service.py
This commit is contained in:
parent
651ed80bbd
commit
2b05ec885a
@ -432,7 +432,7 @@ class WorkerService:
|
|||||||
"hashrate_unit": hashrate_unit,
|
"hashrate_unit": hashrate_unit,
|
||||||
"total_earnings": total_earnings,
|
"total_earnings": total_earnings,
|
||||||
"daily_sats": daily_sats, # Fixed daily_sats value
|
"daily_sats": daily_sats, # Fixed daily_sats value
|
||||||
"avg_acceptance_rate": 95.0, # Default value
|
"avg_acceptance_rate": 98.8, # Default value
|
||||||
"hashrate_history": hashrate_history,
|
"hashrate_history": hashrate_history,
|
||||||
"timestamp": datetime.now(ZoneInfo("America/Los_Angeles")).isoformat()
|
"timestamp": datetime.now(ZoneInfo("America/Los_Angeles")).isoformat()
|
||||||
}
|
}
|
||||||
@ -474,8 +474,8 @@ class WorkerService:
|
|||||||
online_count = max(1, int(num_workers * 0.8)) # At least 1 online worker
|
online_count = max(1, int(num_workers * 0.8)) # At least 1 online worker
|
||||||
offline_count = num_workers - online_count
|
offline_count = num_workers - online_count
|
||||||
|
|
||||||
# Average hashrate per online worker (ensure it's at least 1 TH/s)
|
# Average hashrate per online worker (ensure it's at least 0.5 TH/s)
|
||||||
avg_hashrate = max(1.0, total_hashrate / online_count if online_count > 0 else 0)
|
avg_hashrate = max(0.5, total_hashrate / online_count if online_count > 0 else 0)
|
||||||
|
|
||||||
workers = []
|
workers = []
|
||||||
current_time = datetime.now(ZoneInfo("America/Los_Angeles"))
|
current_time = datetime.now(ZoneInfo("America/Los_Angeles"))
|
||||||
@ -627,8 +627,8 @@ class WorkerService:
|
|||||||
online_count = max(1, int(num_workers * 0.8)) # At least 1 online worker
|
online_count = max(1, int(num_workers * 0.8)) # At least 1 online worker
|
||||||
offline_count = num_workers - online_count
|
offline_count = num_workers - online_count
|
||||||
|
|
||||||
# Average hashrate per online worker (ensure it's at least 1 TH/s)
|
# Average hashrate per online worker (ensure it's at least 0.5 TH/s)
|
||||||
avg_hashrate = max(1.0, total_hashrate / online_count if online_count > 0 else 0)
|
avg_hashrate = max(0.5, total_hashrate / online_count if online_count > 0 else 0)
|
||||||
|
|
||||||
workers = []
|
workers = []
|
||||||
current_time = datetime.now(ZoneInfo("America/Los_Angeles"))
|
current_time = datetime.now(ZoneInfo("America/Los_Angeles"))
|
||||||
@ -664,8 +664,8 @@ class WorkerService:
|
|||||||
hashrate_60sec = round(base_hashrate * random.uniform(0.9, 1.1), 2)
|
hashrate_60sec = round(base_hashrate * random.uniform(0.9, 1.1), 2)
|
||||||
hashrate_3hr = round(base_hashrate * random.uniform(0.85, 1.0), 2)
|
hashrate_3hr = round(base_hashrate * random.uniform(0.85, 1.0), 2)
|
||||||
|
|
||||||
# Generate last share time (within last 5 minutes)
|
# Generate last share time (within last 3 minutes)
|
||||||
minutes_ago = random.randint(0, 5)
|
minutes_ago = random.randint(0, 3)
|
||||||
last_share = (current_time - timedelta(minutes=minutes_ago)).strftime("%Y-%m-%d %H:%M")
|
last_share = (current_time - timedelta(minutes=minutes_ago)).strftime("%Y-%m-%d %H:%M")
|
||||||
|
|
||||||
# Generate acceptance rate (95-100%)
|
# Generate acceptance rate (95-100%)
|
||||||
|
Loading…
Reference in New Issue
Block a user