@Schedule
    public void cleanupExpiredTemporaryBuilds() throws ValidationException {
        log.info("Regular cleanup of expired temporary builds started. Removing builds older than " + TEMPORARY_BUILD_LIFESPAN
                + " days.");

        Date expirationThreshold = TimeUtils.getDateXDaysAgo(TEMPORARY_BUILD_LIFESPAN);

        String authToken = serviceClient.getAuthToken();
        deleteExpiredBuildConfigSetRecords(expirationThreshold, authToken);
        deleteExpiredBuildRecords(expirationThreshold, authToken);

        log.info("Regular cleanup of expired temporary builds finished.");
    }
@Schedule
    public void cleanupExpiredTemporaryBuilds() throws ValidationException {
        log.info("Regular cleanup of expired temporary builds started. Removing builds older than " + TEMPORARY_BUILD_LIFESPAN
                + " days.");

        Date expirationThreshold = TimeUtils.getDateXDaysAgo(TEMPORARY_BUILD_LIFESPAN);

        String authToken = serviceClient.getAuthToken();
        deleteExpiredBuildConfigSetRecords(expirationThreshold, authToken);
        deleteExpiredBuildRecords(expirationThreshold, authToken);

        log.info("Regular cleanup of expired temporary builds finished.");
    }
@ Schedule public void cleanupExpiredTemporaryBuilds ( ) throws ValidationException { log . info ( "Regular cleanup of expired temporary builds started. Removing builds older than " + TEMPORARY_BUILD_LIFESPAN + " days." ) ; Date expirationThreshold = TimeUtils . getDateXDaysAgo ( TEMPORARY_BUILD_LIFESPAN ) ; String authToken = serviceClient . getAuthToken ( ) ; deleteExpiredBuildConfigSetRecords ( expirationThreshold , authToken ) ; deleteExpiredBuildRecords ( expirationThreshold , authToken ) ; log . info ( "Regular cleanup of expired temporary builds finished." ) ; }
Cleanup old temporary builds every midnight
Cleanup old temporary builds every midnight