TerminalWitchcraft / actix-ratelimit

Rate limiter framework for Actix web
MIT License
127 stars 25 forks source link

Error Actix 3 #19

Open pikitgb opened 3 years ago

pikitgb commented 3 years ago

Hi I keep getting this error

rror[E0271]: type mismatch resolving `<RateLimiter<MemoryStoreActor> as Transform<<impl ServiceFactory as ServiceFactory>::Service>>::Request == ServiceRequest`
   --> src/main.rs:164:27
    |
164 |     App::new().wrap(cors).wrap(ratelimiter)
    |                           ^^^^ expected struct `actix_web::service::ServiceRequest`, found struct `ServiceRequest`
    |
    = note: perhaps two different versions of crate `actix_web` are being used?
  let ratelimiter = RateLimiter::new(
      MemoryStoreActor::from(store.clone()).start())
          .with_interval(Duration::from_secs(3))
          .with_max_requests(10);

actix-ratelimit = "0.3.1" actix-web = { version = "3.0.0", features=["openssl"] }

while trying to update to actix 3 not sure what i'm doing wrong

Thanks a lot