Skip to content

Commit

Permalink
remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Nov 30, 2024
1 parent 1f04ece commit 47eae32
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions backend/src/http/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,5 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use lapin::Channel;
use std::sync::Arc;
use warp::http::StatusCode;
use warp::Filter;

use super::ReacherResponseError;

pub mod bulk;
pub mod check_email;

/// Warp filter that extracts lapin Channel, or returns a 503 error if it's not
/// available.
pub fn with_channel(
channel: Option<Arc<Channel>>,
) -> impl Filter<Extract = (Arc<Channel>,), Error = warp::Rejection> + Clone {
warp::any().and_then(move || {
let channel = channel.clone();
async move {
channel.ok_or_else(|| {
warp::reject::custom(ReacherResponseError::new(
StatusCode::SERVICE_UNAVAILABLE,
"Please configure a RabbitMQ instance on Reacher before calling this endpoint",
))
})
}
})
}

0 comments on commit 47eae32

Please sign in to comment.