Skip to content

Commit

Permalink
[refactor] Wiring up with the new API
Browse files Browse the repository at this point in the history
Signed-off-by: dd di cesare <[email protected]>
  • Loading branch information
didierofrivia committed Sep 4, 2024
1 parent 0a97275 commit b513b69
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/filter/http_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,22 @@ impl Filter {
return Action::Continue;
}

// Build Actions from config actions
self.operation_dispatcher.build_operations(rlp, descriptors);
// populate actions in the dispatcher
// call the next on the match

if let Some(result) = self.operation_dispatcher.next() {
match result {
(_state, Ok(call_id)) => {
if let Some(operation) = self.operation_dispatcher.next() {
match operation.get_result() {
Ok(call_id) => {
debug!(
"#{} initiated gRPC call (id# {}) to Limitador",
self.context_id, call_id
);
Action::Pause
}
(_state, Err(e)) => {
Err(e) => {
warn!("gRPC call to Limitador failed! {e:?}");
// TODO(didierofrivia): Get the failure_mode
/*if let FailureMode::Deny = rls.failure_mode() {
if let FailureMode::Deny = operation.get_failure_mode() {
self.send_http_response(500, vec![], Some(b"Internal Server Error.\n"))
} */
}
Action::Continue
}
}
Expand Down

0 comments on commit b513b69

Please sign in to comment.