diff --git a/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildService.groovy b/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildService.groovy index f63d3ec1d..8d90dd7ee 100644 --- a/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildService.groovy +++ b/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildService.groovy @@ -21,10 +21,8 @@ package io.seqera.wave.service.builder import java.util.concurrent.CompletableFuture import groovy.transform.CompileStatic -import io.micronaut.runtime.event.annotation.EventListener import io.seqera.wave.core.RoutePath import io.seqera.wave.service.persistence.WaveBuildRecord - /** * Declare container build service interface * @@ -79,56 +77,6 @@ interface ContainerBuildService { // ** build record operations // ************************************************************** - @EventListener - default void onBuildEvent(BuildEvent event) { - saveBuildRecord(event) - } - - /** - * Store a build record for the given {@link BuildRequest} object. - * - * This method is expected to store the build record associated with the request - * *only* in the short term store caching system, ie. without hitting the - * long-term SurrealDB storage - * - * @param request The build request that needs to be storage - */ - default void createBuildRecord(BuildRequest request) { - final record0 = WaveBuildRecord.fromEvent(new BuildEvent(request)) - createBuildRecord(record0.buildId, record0) - } - - /** - * Store the build record associated with the specified event both in the - * short-term cache (redis) and long-term persistence layer (surrealdb) - * - * @param event The {@link BuildEvent} object for which the build record needs to be stored - */ - default void saveBuildRecord(BuildEvent event) { - final record0 = WaveBuildRecord.fromEvent(event) - saveBuildRecord(record0.buildId, record0) - } - - /** - * Store a build record object. - * - * This method is expected to store the build record *only* in the short term store cache (redis), - * ie. without hitting the long-term storage (surrealdb) - * - * @param buildId The Id of the build record - * @param value The {@link WaveBuildRecord} to be stored - */ - void createBuildRecord(String buildId, WaveBuildRecord value) - - /** - * Store the specified build record both in the short-term cache (redis) - * and long-term persistence layer (surrealdb) - * - * @param buildId The Id of the build record - * @param value The {@link WaveBuildRecord} to be stored - */ - void saveBuildRecord(String buildId, WaveBuildRecord value) - /** * Retrieve the build record for the specified id. * diff --git a/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildServiceImpl.groovy index cc57d4e57..5fb518627 100644 --- a/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/builder/ContainerBuildServiceImpl.groovy @@ -29,6 +29,7 @@ import groovy.transform.CompileStatic import groovy.util.logging.Slf4j import io.micronaut.context.event.ApplicationEventPublisher import io.micronaut.core.annotation.Nullable +import io.micronaut.runtime.event.annotation.EventListener import io.micronaut.scheduling.TaskExecutors import io.seqera.wave.api.BuildContext import io.seqera.wave.auth.RegistryCredentialsProvider @@ -378,25 +379,66 @@ class ContainerBuildServiceImpl implements ContainerBuildService, JobHandler