Commit 95b35580 authored by Robin Tissot's avatar Robin Tissot
Browse files

Merge branch 'develop'

parents c2ceed0a 57ce6281
......@@ -181,19 +181,21 @@ CELERY_RESULT_BACKEND = 'redis://%s:%d' % (REDIS_HOST, REDIS_PORT)
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERYD_ACKS_LATE = True
CELERY_ACKS_LATE = True
# time in seconds a user has to wait after a task is started before being able to recover
TASK_RECOVER_DELAY = 60 * 60 * 24 # 1 day
CELERY_TASK_QUEUES = (
Queue('default', routing_key='default'),
Queue('live', routing_key='live'), # for everything that needs to be done on the spot to update the ui
Queue('low-priority', routing_key='low-priority'),
Queue('gpu', routing_key='gpu'),
Queue('gpu', routing_key='gpu'), # for everything that could use a GPU
)
CELERY_TASK_DEFAULT_QUEUE = 'default'
CELERY_TASK_ROUTES = {
# 'core.tasks.*': {'queue': 'default'},
'core.tasks.recalculate_masks': {'queue': 'live'},
'core.tasks.generate_part_thumbnails': {'queue': 'low-priority'},
'core.tasks.train': {'queue': 'gpu'},
'core.tasks.segtrain': {'queue': 'gpu'},
......
......@@ -26,7 +26,6 @@
{% endwith %}
</td>
<th>
{# <a href="{% url 'document-detail' pk=document.pk %}">{{ document.name }}</a> #}
{{ document.name }}
{% if document.typology %}<br><span class="text-muted"><small>{{ document.typology|default_if_none:'-' }}</small></span>{% endif %}
</th>
......@@ -47,20 +46,20 @@
</td>
{% endcomment %}
<td class="text-right">
{# <a href="{% url 'document-detail' pk=document.pk %}" class="btn btn-info disabled" title="{% trans 'View' %}"><i class="fas fa-eye"></i></a> #}
{# Note that doing one query per row is a lot faster than a subquery for some reason #}
{% if document.last_edited_part %}
<a href="{% url 'document-part-edit' pk=document.pk part_pk=document.last_edited_part.pk %}"
class="btn btn-info"
title="{% trans 'Edit last updated Element' %}">
<i class="fas fa-edit"></i>
</a>
{% endif %}
{# <a href="{% url 'document-detail' pk=document.pk %}" class="btn btn-info disabled" title="{% trans 'View' %}"><i class="fas fa-eye"></i></a> #}
{# Note that doing one query per row is a lot faster than a subquery for some reason #}
{% if document.last_edited_part %}
<a href="{% url 'document-part-edit' pk=document.pk part_pk=document.last_edited_part.pk %}"
class="btn btn-info"
title="{% trans 'Edit last updated Element' %}">
<i class="fas fa-edit"></i>
</a>
{% endif %}
<form method="post" class="inline-form" action="{% url 'document-publish' pk=document.pk %}" onsubmit="return confirm('{% trans "Do you really want to delete the document?" %}');">{% csrf_token %}
<input type="hidden" name="workflow_state" value="{{ document.WORKFLOW_STATE_ARCHIVED }}">
<button type="submit" value="" class="nav-item btn btn-danger" title="{% trans 'Delete' %}"><i class="fas fa-trash"></i></button>
</form>
<form method="post" class="inline-form" action="{% url 'document-publish' pk=document.pk %}" onsubmit="return confirm('{% trans "Do you really want to delete the document?" %}');">{% csrf_token %}
<input type="hidden" name="workflow_state" value="{{ document.WORKFLOW_STATE_ARCHIVED }}">
<button type="submit" value="" onclick='event.stopPropagation();' class="nav-item btn btn-danger" title="{% trans 'Delete' %}"><i class="fas fa-trash"></i></button>
</form>
</td>
</tr>
{% endfor %}
......
......@@ -73,6 +73,10 @@ services:
- OMP_NUM_THREADS=1
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q default -c ${CELERY_MAIN_CONC:-10} --max-tasks-per-child=10"
celery-live:
<<: *app
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q live -c ${CELERY_LIVE_CONC:-10} --max-tasks-per-child=10"
celery-low-priority:
<<: *app
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q low-priority -c ${CELERY_LOW_CONC:-10} --max-tasks-per-child=10"
......
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