mirror of
https://github.com/oSumAtrIX/free-librespot.git
synced 2025-12-19 18:04:20 +00:00
Don't exit if too many spirc failures.
This commit is contained in:
parent
f26db01110
commit
dadab486d2
1 changed files with 8 additions and 7 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -513,18 +513,19 @@ impl Future for Main {
|
||||||
while (!self.auto_connect_times.is_empty()) && ((Instant::now() - self.auto_connect_times[0]).as_secs() > 600) {
|
while (!self.auto_connect_times.is_empty()) && ((Instant::now() - self.auto_connect_times[0]).as_secs() > 600) {
|
||||||
let _ = self.auto_connect_times.remove(0);
|
let _ = self.auto_connect_times.remove(0);
|
||||||
}
|
}
|
||||||
if self.auto_connect_times.len() >= 5 {
|
|
||||||
error!("Spirc shut down too often. Exiting to avoid too many login attempts.");
|
|
||||||
return Ok(Async::Ready(()));
|
|
||||||
}
|
|
||||||
if let Some(credentials) = self.last_credentials.clone() {
|
if let Some(credentials) = self.last_credentials.clone() {
|
||||||
|
if self.auto_connect_times.len() >= 5 {
|
||||||
|
warn!("Spirc shut down too often. Not reconnecting automatically.");
|
||||||
|
} else {
|
||||||
self.auto_connect_times.push(Instant::now());
|
self.auto_connect_times.push(Instant::now());
|
||||||
self.credentials(credentials);
|
self.credentials(credentials);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(ref mut player_event_channel) = self.player_event_channel {
|
if let Some(ref mut player_event_channel) = self.player_event_channel {
|
||||||
if let Async::Ready(Some(event)) = player_event_channel.poll().unwrap() {
|
if let Async::Ready(Some(event)) = player_event_channel.poll().unwrap() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue