euscanwww: Refresh query logic and task queue split in chunks

Added the needed logic for running refresh queries from the web
interface.

Added a simple function to tasks.py that takes an iterable of arguments
and a task and launches many subtasks formed by 32 tasks each (for not
having a huge amount of tasks launched at the same time)

Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
volpino
2012-06-08 14:21:11 +02:00
parent 8913f826de
commit a94a24eeac
4 changed files with 82 additions and 41 deletions

View File

@ -140,8 +140,8 @@
<script type="text/javascript">
$(".refresh-button").click(function() {
var url = "{% url "apply_task" "djeuscan.tasks.scan_upstream_task" %}";
$.post(url, {query: $(this).data("package")}, function() {
var url = "{% url "refresh_package" "x/x" %}";
$.post(url.replace("x/x", $(this).data("package")), function() {
alert("Submitted!");
});
});