Adds a task to the queue for fetching release history data for a project.
We only create a new fetch task if there's no task already in the queue for this particular project (based on 'update_fetch_task' key-value collection).
$project: Associative array of information about a project as created by update_get_projects(), including keys such as 'name' (short name), and the 'info' array with data from a .info.yml file for the project.
function _update_create_fetch_task($project) {
$fetch_tasks =& drupal_static(__FUNCTION__, array());
if (empty($fetch_tasks)) {
$fetch_tasks = drupal_container()
->get('keyvalue')
->get('update_fetch_task')
->getAll();
}
if (empty($fetch_tasks[$project['name']])) {
$queue = Drupal::queue('update_fetch_tasks');
$queue
->createItem($project);
drupal_container()
->get('keyvalue')
->get('update_fetch_task')
->set($project['name'], $project);
$fetch_tasks[$project['name']] = REQUEST_TIME;
}
}