Skip to content

Project and instance-wide maximum TTL

https://redmine.teklia.com/issues/8785

Corpus.maximum_task_ttl is a nullable non-negative integer defaulting to None. It will represent the maximum TTL in seconds that can be set on any WorkerRun in that corpus.

When it is None, the maximum TTL will be specified by settings.PONOS_MAXIMUM_TASK_TTL, which maps to ponos.maximum_task_ttl in the YAML configuration, a non-nullable non-negative integer that defaults to 3600.

This allows defining an instance-wide maximum TTL, but still allows editing the maximum TTL on each project if there are any specific needs.

ListCorpus and RetrieveCorpus should expose maximum_task_ttl so that it can be accessed in the frontend. It is not editable through UpdateCorpus or PartialUpdateCorpus. When Corpus.maximum_task_ttl is None, they should return settings.PONOS_MAXIMUM_TASK_TTL instead, so that the applied maximum TTL is shown.

It should be possible to edit Corpus.maximum_task_ttl through the Django admin, both to set and unset it.

Edited by Erwan Rouchet