File tree Expand file tree Collapse file tree 4 files changed +16
-8
lines changed
Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 6262 uses : actions/checkout@v4
6363
6464 - name : Setup Rust
65- uses : dtolnay/rust-toolchain@1.92 .0
65+ uses : dtolnay/rust-toolchain@1.94 .0
6666
6767 - name : Setup Clippy
6868 run : rustup component add clippy
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ once_cell = "1.21.3"
4343csv = " 1.4.0"
4444mkenv = " 1.0.2"
4545nom = " 8.0.0"
46- pin-project-lite = " 0.2.16 "
46+ pin-project-lite = " 0.2.17 "
4747sea-orm = { version = " 1.1.19" , features = [
4848 " runtime-tokio" ,
4949 " macros" ,
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ once_cell = { workspace = true }
3434records-lib = { path = " ../records_lib" , features = [" tracing" ] }
3535mkenv = { workspace = true }
3636nom = { workspace = true }
37- pin-project-lite = { version = " 0.2.17 " }
37+ pin-project-lite = { workspace = true }
3838request_filter = { path = " ../request_filter" , optional = true }
3939dsc_webhook = { path = " ../dsc_webhook" , features = [" actix-web" ] }
4040sea-orm = { workspace = true }
Original file line number Diff line number Diff line change @@ -54,7 +54,13 @@ impl TimeoutHandler for WebhookTimeoutHandler {
5454 let client = self . 0 . clone ( ) ;
5555
5656 tokio:: task:: spawn ( async move {
57- if let Err ( e) = client. post ( wh_url) . json ( & wh_msg) . send ( ) . await {
57+ if let Err ( e) = client
58+ . post ( wh_url)
59+ . json ( & wh_msg)
60+ . send ( )
61+ . await
62+ . and_then ( |e| e. error_for_status ( ) )
63+ {
5864 tracing:: error!( "couldn't send timeout error to webhook: {e}. body:\n {wh_msg:#?}" ) ;
5965 }
6066 } ) ;
@@ -216,17 +222,19 @@ where
216222 fn poll ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
217223 let this = self . project ( ) ;
218224
219- if let Poll :: Ready ( res) = this. inner_fut . poll ( cx) {
220- return Poll :: Ready ( res) ;
221- }
222-
225+ // To ensure catching the timeout (in case the async runtime is laggy),
226+ // we poll the timer first.
223227 if !* this. is_handled
224228 && let Poll :: Ready ( _) = this. sleep_fut . poll ( cx)
225229 {
226230 this. handler . on_timeout ( this. info ) ;
227231 * this. is_handled = true ;
228232 }
229233
234+ if let Poll :: Ready ( res) = this. inner_fut . poll ( cx) {
235+ return Poll :: Ready ( res) ;
236+ }
237+
230238 Poll :: Pending
231239 }
232240}
You can’t perform that action at this time.
0 commit comments