catalyst / moodle-tool_metadata

Moodle Metadata API
2 stars 0 forks source link

Total extraction processes limit is not honoured when calculated limit is zero #23

Closed tomdickman closed 4 years ago

tomdickman commented 4 years ago

The admin setting for plugin total_extraction_processes is designed to set a maximum process limit for each extractor based on how many extraction tasks are queued, this is currently being ignored if the calculated limit is zero and processing the max_extraction_processes amount of tasks and adding them to the queue.

Issue appears to be related to https://github.com/catalyst/moodle-tool_metadata/blob/master/classes/task/process_extractions_base_task.php#L137 and the use of a 0 (zero) value for the $limitto.

Need to add a conditional to return an empty array of records if the limit is calculated as 0 (zero)