Skip to content

Commit

Permalink
fix(产品管理): 产品启用时会重复触发DeviceProductDeployEvent事件
Browse files Browse the repository at this point in the history
  • Loading branch information
XIXUANHAO committed May 29, 2024
1 parent 3d72223 commit 82b061f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.extern.slf4j.Slf4j;
import org.hswebframework.ezorm.rdb.mapping.ReactiveRepository;
import org.hswebframework.web.bean.FastBeanCopier;
import org.hswebframework.web.crud.events.EntityEventHelper;
import org.hswebframework.web.crud.service.GenericReactiveCrudService;
import org.hswebframework.web.exception.BusinessException;
import org.jetlinks.community.device.entity.DeviceInstanceEntity;
Expand Down Expand Up @@ -47,7 +48,9 @@ public Mono<Integer> deploy(String id) {
.flatMap(i -> FastBeanCopier
.copy(product, new DeviceProductDeployEvent())
.publish(eventPublisher)
.thenReturn(i))
.thenReturn(i)
)
.as(EntityEventHelper::setDoNotFireEvent)
);
}

Expand Down

0 comments on commit 82b061f

Please sign in to comment.