wip: update cat
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 10m0s
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 10m0s
This commit is contained in:
parent
f1d7be2a4c
commit
337b1ab0fd
@ -21,6 +21,7 @@ import io.quarkus.hibernate.reactive.panache.PanacheQuery;
|
||||
import io.quarkus.hibernate.reactive.panache.common.WithSession;
|
||||
import io.quarkus.panache.common.Page;
|
||||
import io.quarkus.panache.common.Sort;
|
||||
import io.quarkus.scheduler.Scheduled;
|
||||
import io.quarkus.vertx.VertxContextSupport;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import io.smallrye.mutiny.unchecked.Unchecked;
|
||||
@ -466,6 +467,17 @@ public class MembreService {
|
||||
.map(__ -> meData);
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 20 16 * * ?")
|
||||
Uni<Void> everySecond() { // TODO change this
|
||||
return repository.list("birth_date IS NOT NULL")
|
||||
.chain(l -> Uni.join().all(l.stream().map(m -> {
|
||||
System.out.println("Cat update for " + m.getObjectName());
|
||||
m.setCategorie(Utils.getCategoryFormBirthDate(m.getBirth_date(), new Date()));
|
||||
return Panache.withTransaction(() -> repository.persist(m));
|
||||
}).toList()).andCollectFailures())
|
||||
.map(__ -> null);
|
||||
}
|
||||
|
||||
public Uni<Response> getLicencePdf(String subject) {
|
||||
return getLicencePdf(repository.find("userId = ?1", subject).firstResult()
|
||||
.call(m -> Mutiny.fetch(m.getLicences())));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user