spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

move eager initialization of `PgVectorStore` from `afterPropertiesSet` to `ApplicationListener<ApplicationReadyEvent>`

Open joshlong opened this issue 1 year ago • 0 comments

at the moment there is initialization done on every run of PgVectorStore, which delays the startup time significantly. (more than double my normal startup time)

It would be good to:

a) make this an opt-in, as it is in Spring Modulith, Spring Session, Spring Batch, Spring Integration, Spring Session, etc. b) move it to a later point in the Spring Boot application lifecycle, like ApplicationListener<ApplicatinoReadyEvent>, instead of afterPropertiesReady. this way, it'll happen after the boot app has reported its startup time

joshlong avatar May 06 '24 10:05 joshlong