mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-03-29 11:11:45 +01:00
fix: Reset countdown on manual refresh & show errors
This commit is contained in:
parent
7ffe5c573c
commit
7822889271
@ -53,7 +53,6 @@ export class SwarmComponent implements OnInit, OnDestroy {
|
||||
this.refreshIntervalRef = window.setInterval(() => {
|
||||
this.refreshIntervalTime --;
|
||||
if(this.refreshIntervalTime <= 0){
|
||||
this.refreshIntervalTime = REFRESH_TIME_SECONDS;
|
||||
this.refreshList();
|
||||
}
|
||||
}, 1000);
|
||||
@ -161,6 +160,7 @@ export class SwarmComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
public refreshList() {
|
||||
this.refreshIntervalTime = REFRESH_TIME_SECONDS;
|
||||
const ips = this.swarm.map(axeOs => axeOs.IP);
|
||||
|
||||
from(ips).pipe(
|
||||
@ -174,10 +174,11 @@ export class SwarmComponent implements OnInit, OnDestroy {
|
||||
}),
|
||||
timeout(5000),
|
||||
catchError(error => {
|
||||
this.toastr.error('Error', 'Failed to get info from ' + ipAddr + ' - ' + error);
|
||||
return of(this.swarm.find(axeOs => axeOs.IP == ipAddr));
|
||||
})
|
||||
),
|
||||
256 // Limit concurrency to avoid overload
|
||||
128 // Limit concurrency to avoid overload
|
||||
),
|
||||
toArray() // Collect all results into a single array
|
||||
).pipe(take(1)).subscribe({
|
||||
|
Loading…
x
Reference in New Issue
Block a user