package jnpf.dmsService.search;
|
|
import lombok.RequiredArgsConstructor;
|
import org.springframework.stereotype.Component;
|
import org.springframework.transaction.event.TransactionPhase;
|
import org.springframework.transaction.event.TransactionalEventListener;
|
|
@Component
|
@RequiredArgsConstructor
|
public class DmsSearchIndexJobCreatedListener {
|
private final DmsSearchIndexQueue queue;
|
|
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT, fallbackExecution = true)
|
public void handle(DmsSearchIndexJobCreatedEvent event) {
|
queue.push(event.getTask());
|
}
|
}
|