diff --git a/HISTORY.rst b/HISTORY.rst index e3607d6360..0cee20623b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -97,6 +97,9 @@ cache invalidation is tied to index updates. This makes the timeout less relevant. The purpose of the cache timeout is now avoid runaway memory usage. +- Refactored the workflow preview generation to work as an + background task API service. Solves GitLab issue #532. + A new task queue named "document_states_fast" was created. 3.1.9 (2018-11-01) ================== diff --git a/docker/etc/supervisor/mayan.conf b/docker/etc/supervisor/mayan.conf index 646be4c10b..fb7e54e5e2 100644 --- a/docker/etc/supervisor/mayan.conf +++ b/docker/etc/supervisor/mayan.conf @@ -22,7 +22,7 @@ user = root [program:mayan-worker-fast] autorestart = false autostart = true -command = nice -n 1 /bin/bash -c "${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_MODULE} worker -Ofair -l ERROR -Q converter,sources_fast -n mayan-worker-fast.%%h ${MAYAN_WORKER_FAST_CONCURRENCY}" +command = nice -n 1 /bin/bash -c "${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_MODULE} worker -Ofair -l ERROR -Q converter,document_states_fast,sources_fast -n mayan-worker-fast.%%h ${MAYAN_WORKER_FAST_CONCURRENCY}" killasgroup = true numprocs = 1 priority = 998 diff --git a/docs/chapters/deploying.rst b/docs/chapters/deploying.rst index d39317f834..5c3dedb81c 100644 --- a/docs/chapters/deploying.rst +++ b/docs/chapters/deploying.rst @@ -107,7 +107,7 @@ Create the supervisor file at ``/etc/supervisor/conf.d/mayan.conf``: [program:mayan-worker-fast] autorestart = true autostart = true - command = nice -n 1 /opt/mayan-edms/bin/mayan-edms.py celery worker -Ofair -l ERROR -Q converter,sources_fast -n mayan-worker-fast.%%h --concurrency=1 + command = nice -n 1 /opt/mayan-edms/bin/mayan-edms.py celery worker -Ofair -l ERROR -Q converter,document_states_fast,sources_fast -n mayan-worker-fast.%%h --concurrency=1 killasgroup = true numprocs = 1 priority = 998 @@ -276,7 +276,7 @@ Create the supervisor file at ``/etc/supervisor/conf.d/mayan.conf``: [program:mayan-worker-fast] autorestart = true autostart = true - command = nice -n 1 /opt/mayan-edms/bin/mayan-edms.py celery worker -Ofair -l ERROR -Q converter,sources_fast -n mayan-worker-fast.%%h + command = nice -n 1 /opt/mayan-edms/bin/mayan-edms.py celery worker -Ofair -l ERROR -Q converter,document_states_fast,sources_fast -n mayan-worker-fast.%%h killasgroup = true numprocs = 1 priority = 998 diff --git a/mayan/apps/appearance/templates/appearance/generic_form_instance.html b/mayan/apps/appearance/templates/appearance/generic_form_instance.html index 089dfa63b0..e6c07ca5bd 100644 --- a/mayan/apps/appearance/templates/appearance/generic_form_instance.html +++ b/mayan/apps/appearance/templates/appearance/generic_form_instance.html @@ -4,7 +4,9 @@ {% load appearance_tags %} -{{ form.media.render_css|safe }} +{% for asset in form.media.render_css %} + {{ asset|safe }} +{% endfor %} {% for group, errors in form.errors.items %} {% for error in errors %} @@ -38,83 +40,82 @@ {% endfor %} {% else %} - {% for field in form.hidden_fields %} {{ field }} {% endfor %} - {% for field in form.visible_fields %} -
- {# We display the label then the field for all except checkboxes #} - {% if field|widget_type != 'checkboxinput' and not field.field.widget.attrs.hidden %} - {% if not hide_labels %}{{ field.label_tag }}{% if field.field.required and not read_only %} ({% trans 'required' %}){% endif %}{% endif %} - {% endif %} - {% if field|widget_type == 'checkboxinput' %} -
- -
- {% elif field|widget_type == 'emailinput' %} - {% if read_only %} - {{ field.value }} - {% else %} - {% render_field field class+="form-control" %} - {% endif %} - {% elif field|widget_type == 'textinput' %} - {% if read_only %} - {{ field.value }} - {% else %} - {% render_field field class+="form-control" %} - {% endif %} - {% elif field|widget_type == 'textarea' %} - {% if read_only %} - {{ field.value }} - {% else %} - {% render_field field class+="form-control" %} - {% endif %} - {% elif field|widget_type == 'select' %} - {% if read_only %} - {{ field|get_choice_value }} - {% else %} - {% render_field field class+="form-control" %} - {% endif %} - {% elif field|widget_type == 'selectmultiple' %} - {% if read_only %} - {{ field|get_choice_value }} - {% else %} - {% render_field field class+="form-control" %} - {% endif %} - {% elif field|widget_type == 'clearablefileinput' %} - {# Don't add 'form-control' class to filebrowse fields #} - {% if field.errors %} - {% render_field field class+="form-control" %} - {% else %} - {% render_field field class+="" %} - {% endif %} - {% elif field|widget_type == 'radioselect' %} -
- {% render_field field %} -
- {% elif field|widget_type == 'checkboxselectmultiple' %} - {% for option in field %} -
- {{ option }} -
- {% endfor %} - {% elif field|widget_type == 'datetimeinput' or field|widget_type == 'dateinput' %} - {% if read_only %} - {{ field.value }} - {% else %} - {% render_field field class+="form-control" %} - {% endif %} + {% for field in form.visible_fields %} +
+ {# We display the label then the field for all except checkboxes #} + {% if field|widget_type != 'checkboxinput' and not field.field.widget.attrs.hidden %} + {% if not hide_labels %}{{ field.label_tag }}{% if field.field.required and not read_only %} ({% trans 'required' %}){% endif %}{% endif %} + {% endif %} + {% if field|widget_type == 'checkboxinput' %} +
+ +
+ {% elif field|widget_type == 'emailinput' %} + {% if read_only %} + {{ field.value }} {% else %} {% render_field field class+="form-control" %} {% endif %} + {% elif field|widget_type == 'textinput' %} + {% if read_only %} + {{ field.value }} + {% else %} + {% render_field field class+="form-control" %} + {% endif %} + {% elif field|widget_type == 'textarea' %} + {% if read_only %} + {{ field.value }} + {% else %} + {% render_field field class+="form-control" %} + {% endif %} + {% elif field|widget_type == 'select' %} + {% if read_only %} + {{ field|get_choice_value }} + {% else %} + {% render_field field class+="form-control" %} + {% endif %} + {% elif field|widget_type == 'selectmultiple' %} + {% if read_only %} + {{ field|get_choice_value }} + {% else %} + {% render_field field class+="form-control" %} + {% endif %} + {% elif field|widget_type == 'clearablefileinput' %} + {# Don't add 'form-control' class to filebrowse fields #} + {% if field.errors %} + {% render_field field class+="form-control" %} + {% else %} + {% render_field field class+="" %} + {% endif %} + {% elif field|widget_type == 'radioselect' %} +
+ {% render_field field %} +
+ {% elif field|widget_type == 'checkboxselectmultiple' %} + {% for option in field %} +
+ {{ option }} +
+ {% endfor %} + {% elif field|widget_type == 'datetimeinput' or field|widget_type == 'dateinput' %} + {% if read_only %} + {{ field.value }} + {% else %} + {% render_field field class+="form-control" %} + {% endif %} + {% else %} + {% render_field field class+="form-control" %} + {% endif %} - {% if field.help_text %}

{{ field.help_text|safe }}

{% endif %} -
- {% endfor %} + {% if field.help_text %}

{{ field.help_text|safe }}

{% endif %} +
+ {% endfor %} {% endif %}