From 0af8b60e39f350e76bfad654c047a42c741e95ab Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 7 Dec 2009 11:18:13 +0000 Subject: [PATCH] "Maximum number of titles to query from an application at once (to NOT trash mysql)" --- phpgwapi/inc/class.egw_link.inc.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.egw_link.inc.php b/phpgwapi/inc/class.egw_link.inc.php index 5ce9d5f5d7..3771517f66 100644 --- a/phpgwapi/inc/class.egw_link.inc.php +++ b/phpgwapi/inc/class.egw_link.inc.php @@ -597,6 +597,11 @@ class egw_link extends solink return $title; } + /** + * Maximum number of titles to query from an application at once (to NOT trash mysql) + */ + const MAX_TITLES_QUERY = 100; + /** * Query the titles off multiple id's of one app * @@ -631,10 +636,13 @@ class egw_link extends solink } if ($ids_to_query) { - foreach(ExecMethod(self::$app_register[$app]['titles'],$ids_to_query) as $id => $t) + for ($n = 0; $ids = array_slice($ids_to_query,$n*MAX_TITLES_QUERY,100); ++$n) { - $title =& self::get_cache($app,$id); - $titles[$id] = $title = $t; + foreach(ExecMethod(self::$app_register[$app]['titles'],$ids) as $id => $t) + { + $title =& self::get_cache($app,$id); + $titles[$id] = $title = $t; + } } } return $titles;