Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation @Timeable doesn't work #263

Closed
YuriHagel opened this issue Feb 16, 2020 · 10 comments
Closed

Annotation @Timeable doesn't work #263

YuriHagel opened this issue Feb 16, 2020 · 10 comments

Comments

@YuriHagel
Copy link

YuriHagel commented Feb 16, 2020

Hello!
Annotation @timeable doesn't work
public class Test {
public static void main(String[] args) {
slow();
}

@Timeable(limit = 1, unit = TimeUnit.MILLISECONDS)
public static void slow() {
    try {
        TimeUnit.SECONDS.sleep(3);
        System.out.println("ereetreter");
    } catch (InterruptedException e) {
        e.printStackTrace();
        throw new IllegalArgumentException("Query timeout in stored procedure");
    }
}

}

com.jcabi jcabi-aspects 0.22.6 org.aspectj aspectjrt 1.6.12 runtime
@0crat
Copy link

0crat commented Feb 16, 2020

@yegor256/z please, pay attention to this issue

@0crat
Copy link

0crat commented Feb 16, 2020

@YuriHagel/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!

@YuriHagel YuriHagel changed the title Annotation Timeable Annotation @Timeable doesn't work Feb 16, 2020
@gbham
Copy link

gbham commented Nov 25, 2020

any progress?

@yegor256
Copy link
Member

@YuriHagel how exactly it doesn't work? Also, did you do the weaving? Read this: https://www.yegor256.com/2014/06/01/aop-aspectj-java-method-logging.html

@gbham
Copy link

gbham commented Nov 25, 2020

@yegor256 I used this article: https://aspects.jcabi.com/example-weaving.html

I done as instructed but function just ignores the Timeable and continues as normal.

@yegor256
Copy link
Member

@YuriHagel this means only one thing -- weaving doesn't work

@gbham
Copy link

gbham commented Nov 25, 2020

@yegor256 So you are saying there is nothing wrong with @timeable?

@yegor256
Copy link
Member

@YuriHagel it is used in many projects for many years. It does work :)

@gbham
Copy link

gbham commented Nov 25, 2020

@yegor256 To claim it works in every environment when there are 2 open issues seems a bit premature to me. I will take a closer look at the weaving then.

@andreoss
Copy link
Collaborator

Closing in favor of #249

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants