Commit 4eb11600 authored by Szabolcs Gyurko's avatar Szabolcs Gyurko
Browse files

Small fix to put job from paused to waiting status if the user starts it and...

Small fix to put job from paused to waiting status if the user starts it and there are no more jobs allowed
parent 6208b3d9
......@@ -16,7 +16,7 @@ class Queue @Inject() (val messagesApi: MessagesApi, val sget2: SGet2) extends C
}
def js = Action {
Ok(views.js.queue()).as("text/javascript utf-8")
Ok(views.js.queue()).as("text/javascript")
}
def home = Action {
......
......@@ -61,7 +61,10 @@ class DownloadQueue (private val sget2: SGet2, private val dbConfigProvider: Dat
*/
private def start(job: DownloadJob): Unit = {
val maxActiveJobs = sget2.settings.getOrElse(Defaults.SETTING_MAX_ACTIVE_JOBS, None)
if (maxActiveJobs.nonEmpty && activeJobs == maxActiveJobs.get.toInt) return
if (maxActiveJobs.nonEmpty && activeJobs == maxActiveJobs.get.toInt) {
job.status = DownloadJobStatusCode.WAITING
return
}
val worker = job.url.getProtocol match {
case "http" Some(new HttpWorker(job, sget2))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment