Commit 436696b0 authored by drumm's avatar drumm
Browse files

Issue #3117465 by drumm: Load fewer releases at a time

parent b4f4fdd3
......@@ -64,15 +64,15 @@ function project_usage_update_7003() {
->entityCondition('bundle', project_release_release_node_types())
->execute();
if (isset($result['node'])) {
foreach (array_chunk(array_keys($result['node']), 100) as $releases) {
foreach (node_load_multiple($releases, array(), TRUE) as $release) {
foreach (array_chunk(array_keys($result['node']), 50) as $releases) {
foreach (node_load_multiple($releases, [], TRUE) as $release) {
$project_release_nids[$release->field_release_project[LANGUAGE_NONE][0]['target_id']][] = $release->nid;
}
}
}
foreach ($project_release_nids as $project_nid => $release_nids) {
db_update('project_usage_week_release')
->condition('nid', [$release_nids])
->condition('nid', $release_nids)
->fields(['project_nid' => $project_nid])
->execute();
}
......@@ -82,7 +82,11 @@ function project_usage_update_7003() {
* Index {project_usage_week_release}.project_nid field.
*/
function project_usage_update_7004() {
db_add_index('project_usage_week_release', 'timestamp_project_count', ['timestamp', 'project_nid', 'count']);
db_add_index('project_usage_week_release', 'timestamp_project_count', [
'timestamp',
'project_nid',
'count',
]);
}
/**
......
Supports Markdown
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