Project

General

Profile

« Previous | Next » 

Revision 3098

Added by perry about 18 years ago

Ensure that spatial operations are only triggered when runSpatialOption is set to true.

View differences:

src/edu/ucsb/nceas/metacat/MetaCatServlet.java
213 213

  
214 214
            /*
215 215
             *  If spatial option is turned on and set to regenerate the
216
             *  spatial cache on restart, trigger the harvester 
216
             *  spatial cache on restart, trigger the harvester regeneratation method 
217 217
             */
218 218
            if ( MetaCatUtil.getOption("runSpatialOption").equals("true") &&
219 219
                 MetaCatUtil.getOption("regenerateCacheOnRestart").equals("true") ) {
......
2255 2255
                    out.println("</success>");
2256 2256
                    logMetacat.info("Document deleted.");
2257 2257

  
2258
                    // Delete from spatial cache
2259
                    SpatialHarvester sh = new SpatialHarvester();
2260
                    sh.addToDeleteQue( MetaCatUtil.getSmartDocId( docid[0] ) );
2261
                    sh.destroy();
2258
                    // Delete from spatial cache if runningSpatialOption
2259
		    if ( MetaCatUtil.getOption("runSpatialOption").equals("true") ) {
2260
                        SpatialHarvester sh = new SpatialHarvester();
2261
                        sh.addToDeleteQue( MetaCatUtil.getSmartDocId( docid[0] ) );
2262
                        sh.destroy();
2263
	            }
2262 2264

  
2263 2265
                }
2264 2266
                catch (AccessionNumberException ane) {
src/edu/ucsb/nceas/metacat/DocumentImpl.java
1341 1341
    	logMetacat.warn("BuildIndex complete for docid " + docid);
1342 1342

  
1343 1343
        // Adds the docid to the spatial data cache 
1344
        SpatialHarvester spatialHarvester = new SpatialHarvester();
1345
        logMetacat.warn(" --------- Attempting to update the spatial cache for docid " + docid );
1346
        spatialHarvester.addToUpdateQue(docid);
1347
        spatialHarvester.destroy();
1344
        if ( MetaCatUtil.getOption("runSpatialOption").equals("true") ) {
1345
            SpatialHarvester spatialHarvester = new SpatialHarvester();
1346
            logMetacat.warn(" --------- Attempting to update the spatial cache for docid " + docid );
1347
            spatialHarvester.addToUpdateQue(docid);
1348
            spatialHarvester.destroy();
1349
	}
1348 1350
        
1349 1351
    }
1350 1352

  

Also available in: Unified diff