Permalink
Browse files

use pessimistic lock to update download increment, reduce number of o…

…bjects cached in memory, add valid BuildConfig.groovy for 1.2
  • Loading branch information...
graemerocher committed Nov 16, 2009
1 parent 051ada7 commit 6c71fb199bee2d9ccb25844ac7bcfddbb872e01a
@@ -1,3 +1,36 @@
grails.project.work.dir = "target"
grails.project.test.reports.dir = "target/test-reports"
grails.project.plugins.dir = "plugins"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits( "global" ) {
// uncomment to disable oscache
// excludes 'oscache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
repositories {
grailsPlugins()
grailsHome()
// uncomment the below to enable remote dependency resolution
// from public Maven repositories
//mavenLocal()
//mavenCentral()
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
// uncomment to enable ehcache
runtime ("net.sf.ehcache:ehcache:1.6.1") {
excludes 'jms', 'commons-logging', 'servlet-api'
}
// runtime 'mysql:mysql-connector-java:5.1.5'
}
}
@@ -1,15 +1,12 @@
<ehcache>
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="10000"
maxElementsInMemory="300"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
overflowToDisk="false"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
@@ -9,22 +9,27 @@ beans = {
textCache(EhCacheFactoryBean) {
timeToLive = 300
maxElementsInMemory = 100
overflowToDisk=false
}
downloadCache(EhCacheFactoryBean) {
timeToLive = 300
maxElementsInMemory = 100
overflowToDisk=false
}
contentCache(EhCacheFactoryBean) {
timeToLive = 300
maxElementsInMemory = 200
overflowToDisk=false
}
wikiCache(EhCacheFactoryBean) {
timeToLive = 300
maxElementsInMemory = 200
overflowToDisk=false
}
pluginListCache(EhCacheFactoryBean) {
timeToLive = 600
maxElementsInMemory = 100
overflowToDisk=false
}
contentToMessage(ContentAlertStack)
wikiContext(BaseInitialRenderContext)
@@ -63,10 +63,17 @@ class DownloadController {
def downloadFile = {
def mirror = params.mirror? Mirror.lock(params.mirror) : null
def mirror = params.mirror? Mirror.get(params.mirror) : null
if(mirror) {
def download = mirror.file.download
def download = Download.createCriteria().get {
files {
mirrors {
eq 'id', mirror.id
}
}
lock true
}
download.count++
download.save(flush:true)

0 comments on commit 6c71fb1

Please sign in to comment.