Skip to content

Commit

Permalink
Merge pull request #898 from zefciu/timeout
Browse files Browse the repository at this point in the history
Timeout of rq_jobs is configurable
  • Loading branch information
andrzej-jankowski committed May 28, 2014
2 parents 661cf28 + d5be7b4 commit 3732da4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ralph/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,3 +730,4 @@
},
},
}
RQ_TIMEOUT = 3000
7 changes: 6 additions & 1 deletion src/ralph/util/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import rq
import copy

from django.conf import settings
from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.sessions.middleware import SessionMiddleware
from django.core.urlresolvers import resolve
Expand Down Expand Up @@ -76,7 +77,11 @@ def set_progress(job, progress):

# This is removed as top-level function so rq can find it
def enqueue(view, request):
return view.queue.enqueue(get_result, PicklableRequest(request))
return view.queue.enqueue_call(
func=get_result,
args=(PicklableRequest(request),),
timeout=settings.RQ_TIMEOUT,
)


class Report(View):
Expand Down

0 comments on commit 3732da4

Please sign in to comment.