Changeset 572 for trunk


Ignore:
Timestamp:
Jun 6, 2010, 12:11:54 AM (15 years ago)
Author:
gav
Message:

Stop lucene mirroring and reindex after bulk data creation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/CreateBulkDataService.groovy

    r548 r572  
    1212    def dateUtilService
    1313    def appConfigService
     14    def searchableService
    1415    def assignedGroupService
    1516    def assignedPersonService
     
    4142        if(GrailsUtil.environment != "development")
    4243            return fail(code: 'default.not.development.environment.failure')
     44
     45        log.info "Stop mirroring lucene index."
     46        searchableService.stopMirroring()
    4347
    4448        log.info "Creating BULK data..."
     
    7882
    7983        log.info "Creating BULK data...complete."
     84
     85        log.info "Start mirroring lucene index."
     86        searchableService.startMirroring()
     87        log.info "Rebuilding lucene text search index."
     88        searchableService.reindex()
     89        log.info "Rebuilding lucene text search index, complete."
     90
    8091        return result
    8192
     
    95106        if(GrailsUtil.environment != "development")
    96107            return fail(code: 'default.not.development.environment.failure')
     108
     109        log.info "Stop mirroring lucene index."
     110        searchableService.stopMirroring()
    97111
    98112        log.info "Creating BULK data..."
     
    106120
    107121        log.info "Creating BULK data...complete."
     122
     123        log.info "Start mirroring lucene index."
     124        searchableService.startMirroring()
     125        log.info "Rebuilding lucene text search index."
     126        searchableService.reindex()
     127        log.info "Rebuilding lucene text search index, complete."
     128
    108129        return result
    109130
     
    263284        range.each() {
    264285
    265             if(it % 100 == 0) {
     286            if(it % 25 == 0) {
    266287                logStatus("Creating inventory location #" + it)
    267288                cleanUpGorm()
     
    305326        range.each() {
    306327
    307             if(it % 100 == 0) {
     328            if(it % 50 == 0) {
    308329                logStatus("Creating inventory item #" + it)
    309330                cleanUpGorm()
Note: See TracChangeset for help on using the changeset viewer.