}
</script>
+{% if not task.done %}
+<script>
+function worker() {
+ $.ajax({
+ data:{csrfmiddlewaretoken: '{{ csrf_token }}'},
+ url: "/refresh_done1/{{task.id}}/",
+ type:"post",
+ success: function(data) {
+ document.location.reload();
+ },
+ complete: function() {
+ // Schedule the next request when the current one's complete
+ setTimeout(worker, 30000);
+ }
+ });
+};
+$(document).ready(function() {
+ // run the first time; all subsequent calls will take care of themselves
+ setTimeout(worker, 30000);
+});
+</script>
+{% endif %}
+
{% endblock %}