GithubHelp home page GithubHelp logo

Comments (17)

geofmureithi avatar geofmureithi commented on August 26, 2024 1

I will check the problem then close it.

from apalis.

IgnisDa avatar IgnisDa commented on August 26, 2024

Tried changing the order of layers, count from 3 -> 1. Did not work.

from apalis.

IgnisDa avatar IgnisDa commented on August 26, 2024

https://github.com/IgnisDa/ryot/blob/b9019dfa1f5948c071857a076ac7e14146d592d8/apps/backend/src/main.rs#L310-L322 are the lines if you are interested.

from apalis.

geofmureithi avatar geofmureithi commented on August 26, 2024

from apalis.

IgnisDa avatar IgnisDa commented on August 26, 2024

@geofmureithi I am not sure what I need to do with the methods you gave. I added them to my code, it didn't change the error.

from apalis.

geofmureithi avatar geofmureithi commented on August 26, 2024

Have you checked this issue?
#256

from apalis.

geofmureithi avatar geofmureithi commented on August 26, 2024

See also
tokio-rs/axum#987 (reply in thread)

The issue is that from 0.5 apalis needs the service to be clone yet tower rate limit is not clone.

The suggested option is to include BufferLayer infront of the rate limit one.

from apalis.

IgnisDa avatar IgnisDa commented on August 26, 2024

The suggested option is to include BufferLayer infront of the rate limit one.

I did that, still does not work. The error has changed:
image

from apalis.

geofmureithi avatar geofmureithi commented on August 26, 2024

Seems the issue here is with tower.
Can you try using .chain
Can you also try using a custom implementation eg https://medium.com/@khalludi123/creating-a-rate-limiter-middleware-using-tower-for-axum-rust-be1d65fbeca

from apalis.

IgnisDa avatar IgnisDa commented on August 26, 2024

Got it working with:

            .register_with_count(
                1,
                WorkerBuilder::new("perform_application_job")
                    .data(importer_service_1.clone())
                    .data(exporter_service_1.clone())
                    .data(media_service_4.clone())
                    .data(exercise_service_1.clone())
                    .with_storage(perform_application_job_storage.clone())
                    .chain(|s| {
                        s.layer(BufferLayer::new(1024))
                            .layer(ApalisRateLimitLayer::new(
                                rate_limit_num,
                                Duration::new(5, 0),
                            ))
                            .layer(ApalisTraceLayer::new())
                    })
                    .build_fn(perform_application_job),
            )

Should I keep this issue open? (Since I had to use a workaround).

from apalis.

IgnisDa avatar IgnisDa commented on August 26, 2024

Cool! Thanks for your guidance.

from apalis.

IgnisDa avatar IgnisDa commented on August 26, 2024

@geofmureithi Any updates on this?

from apalis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.