Skip to content
Snippets Groups Projects
Commit 17ebb979 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added getThreads function

parent 5a4df715
No related branches found
No related tags found
No related merge requests found
......@@ -125,6 +125,13 @@ class Config(var map: Map[String,Any]) extends Logging {
}
def getAsConfig(s:String) : Config = if (contains(s)) new Config(getAsMap(s)) else new Config(Map())
def getThreads(default:Int) : Int = {
val maxThreads = this.getAsInt("maxthreads", 8)
val threads = this.getAsInt("threads", default)
if (maxThreads > threads) return threads
else return maxThreads
}
override def toString() : String = map.toString
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment