Ignore:
Timestamp:
Jan 19, 2011, 2:19:10 PM (13 years ago)
Author:
robert@…
Message:

Resolved two bugs in synchronization:

  • full synchronization didn't work when no studies were present in the database (initial synchronization)
  • synchronization didn't work with spaces in the end of a studyToken
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/nl/tno/metagenomics/integration/SynchronizationService.groovy

    r4 r6  
    103103                def studies
    104104                if( eager ) {
    105                         studies = Study.list().findAll { !it.trashcan };
    106                         log.trace "Eager synchronization: " + studies.size();
     105                        studies = []
     106                        log.trace "Eager synchronization";
    107107                } else {
    108108                        studies = Study.findAllWhere( [isDirty: true] );
    109109                        log.trace "Default synchronization: " + studies.size()
     110
     111                        // Perform no synchronization if no studies have to be synchronized
     112                        if( studies.size() == 0 )
     113                                return []
    110114                }
    111115               
    112                 // Perform no synchronization if no studies have to be synchronized
    113116                // Perform synchronization on only one study directly, because otherwise
    114117                // the getStudies method could throw a ResourceNotFoundException or NotAuthorizedException
    115118                // that can better be handled by synchronizeStudy
    116                 if( studies.size() == 0 ) {
    117                         return []
    118                 } else if( studies.size() == 1 ) {
    119                         println "Study: " + studies[ 0]
     119                if( studies.size() == 1 ) {
    120120                        def newStudy = synchronizeStudy( studies[0] );
    121121                        if( newStudy )
Note: See TracChangeset for help on using the changeset viewer.