Skip to content

Commit

Permalink
fix: retry failed requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrix126 committed Oct 31, 2024
1 parent 517c592 commit a9efa2b
Show file tree
Hide file tree
Showing 15 changed files with 234 additions and 81 deletions.
162 changes: 150 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ egui_extras = {version="0.29.1", features = ["image"] }
env_logger = "0.11.5"
figment = { version = "0.10.19", features = ["toml"] }
reqwest = {version = "0.12.9", default-features=false, features=["json", "rustls-tls"]}
reqwest-middleware = "0.3"
reqwest-retry = "0.6"
image = { version = "0.25.4", features = ["png"] }
log = "0.4.22"
num-format = { version = "0.4.4", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion src/app/eframe_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl eframe::App for App {
// xvb_is_alive is not the same for bottom and for middle.
// for status we don't want to enable the column when it is retrying request
// but for bottom we don't want the user to be able to start it in this case.
let xvb_is_alive = xvb_state != ProcessState::Retry && xvb_state != ProcessState::Dead;
let xvb_is_alive = xvb_state != ProcessState::Dead;
self.middle_panel(
ctx,
frame,
Expand Down
10 changes: 5 additions & 5 deletions src/app/panels/bottom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ fn status_p2pool(state: ProcessState, ui: &mut Ui, size: Vec2) {
color = ORANGE;
P2POOL_SYNCING
}
Middle | Waiting | NotMining | OfflineNodesAll | Retry => {
Middle | Waiting | NotMining | OfflineNodesAll => {
color = YELLOW;
P2POOL_MIDDLE
}
Expand All @@ -940,7 +940,7 @@ fn status_node(state: ProcessState, ui: &mut Ui, size: Vec2) {
color = ORANGE;
NODE_SYNCING
}
Middle | Waiting | NotMining | OfflineNodesAll | Retry => {
Middle | Waiting | NotMining | OfflineNodesAll => {
color = YELLOW;
NODE_MIDDLE
}
Expand All @@ -967,7 +967,7 @@ fn status_xmrig(state: ProcessState, ui: &mut Ui, size: Vec2) {
color = ORANGE;
XMRIG_NOT_MINING
}
Middle | Waiting | Syncing | Retry => {
Middle | Waiting | Syncing => {
color = YELLOW;
XMRIG_MIDDLE
}
Expand All @@ -994,7 +994,7 @@ fn status_xp(state: ProcessState, ui: &mut Ui, size: Vec2) {
color = ORANGE;
XMRIG_PROXY_NOT_MINING
}
Middle | Waiting | Syncing | Retry => {
Middle | Waiting | Syncing => {
color = YELLOW;
XMRIG_PROXY_MIDDLE
}
Expand All @@ -1012,7 +1012,7 @@ fn status_xvb(state: ProcessState, ui: &mut Ui, size: Vec2) {
color = GRAY;
XVB_DEAD
}
Failed | Retry => {
Failed => {
color = RED;
XVB_FAILED
}
Expand Down
Loading

0 comments on commit a9efa2b

Please sign in to comment.