Ignore:
Timestamp:
Feb 7, 2011, 4:07:54 PM (11 years ago)
Author:
robert@…
Message:
  • Number of seconds for the rest controller to keep data in cache is now a configuration option
  • After searching, it is possible to choose which action to perform on the search results.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/dbnp/modules/ModuleCommunicationService.groovy

    r1482 r1501  
    1818import grails.converters.*
    1919import javax.servlet.http.HttpServletResponse
     20import org.codehaus.groovy.grails.commons.ConfigurationHolder
    2021
    2122class ModuleCommunicationService implements Serializable {
     
    3334         * Number of seconds to save the data in cache
    3435         */
    35         def numberOfSecondsInCache = 10 * 60;
     36        def numberOfSecondsInCache = Integer.valueOf( ConfigurationHolder.config.modules.cacheDuration )
    3637
    3738        /**
     
    147148                def user = authenticationService.getLoggedInUser();
    148149                def userId = user ? user.id : -1;
    149 
     150               
     151                println "Retrieve from cache: " + url
     152                println "Seconds in cache: " + numberOfSecondsInCache
     153               
    150154                if( cache[ userId ] && cache[ userId ][ url ] && ( System.currentTimeMillis() - cache[ userId ][ url ][ "timestamp" ] ) < numberOfSecondsInCache * 1000 ) {
    151155                        return cache[ userId ][ url ];
Note: See TracChangeset for help on using the changeset viewer.