actframework icon indicating copy to clipboard operation
actframework copied to clipboard

@Before priority BUG

Open kukume opened this issue 4 years ago • 4 comments

@Before注解中,其中priority属性默认为0。 我这里有2个@Before注解,其中一个没有填写priority属性,其中一个填写了priority属性,填写了priority属性(无论为何值)的before方法会慢于没有填写priority属性的before方法, image 如图所示,其中没有填写priority属性的before方法为null,填写了的为填写的值,但是为null的before方法总是会在填写了priority属性的before方法之前执行 按照@Before注解,没有填写priority属性默认值应为0

kukume avatar Oct 06 '21 07:10 kukume

@kukume

The lesser the value is, the higher the priority it got. If you want to make the second Before method to be executed first, try to give a bigger number for the first @Before

Refer: https://github.com/actframework/act-doc/blob/master/en/interceptor.md

greenlaw110 avatar Oct 14 '21 03:10 greenlaw110

@greenlaw110 但是没写priority属性默认不应该为0吗,我用了全局的before和非全局的before,如果默认属性为0的话,我只需要在全局的before把priority属性写成负数就可以了,但是priority为null,我就需要为每一个before都写上priority

kukume avatar Oct 14 '21 07:10 kukume

@kukume

Can you try 1.9.2-SNAPSHOT ?

greenlaw110 avatar Oct 16 '21 12:10 greenlaw110

没有问题了。

kukume avatar Oct 17 '21 07:10 kukume