99% CPU for Apache2 after a Reloading

Author Message

David P

Thursday 07 December 2006 6:27:57 am

When I load this tempate all is good but (apache and the render) after a reloading, Apache get 99% of CPU.

My code :

			{def $chemin=array()}
			{def $current_node=$node.parent}

			{while ne($current_node.path_string, "/1/2/")}
				{set $chemin=$chemin|insert($chemin|count()|dec, $current_node)}
				{set $current_node=$current_node.parent}
			{/while}
			
			{if $chemin}
				<ul>
					<li><a href={$chemin_item[0].url_alias|ezurl()}>{$chemin[0].name}</a>
					{set $chemin=$chemin|remove(0)}
					{foreach $chemin as $chemin_item}
						<ul><li>
								<a href={$chemin_item.url_alias|ezurl()}>{$chemin_item.name}</a>
					{/foreach}
					
					{foreach $chemin as $item} 
							</li></ul>
					{/foreach}
					
					{def $nodetofetch=$module_result.content_info.parent_node_id}
			{else}
				<ul><li>{$node.name}
				{def $nodetofetch=$module_result.node_id}
			{/if}

			{def $first_items=fetch( content, list, 
				hash( parent_node_id, 		$nodetofetch, 
				  	  sort_by,				array( 
						array( priority,		false() ),
						array( name,			true() ) ),
					  limit,				50 ) )
			}
			
			{if $first_items}			
				<ul>
					{def $nb=0}
					{foreach $first_items as $first_item}
						<li>
							<a href={$first_item.url_alias|ezurl()}>{$first_item.name}</a>
							
							{if $chemin}

			{def $sub_items=fetch( content, list, 
				hash( parent_node_id, 		$first_item.node_id, 
				  	  sort_by,				array( 
						array( priority,		false() ),
						array( name,			true() ) ),
					  limit,				50 ) )
			}								
								
								{if $sub_items}
									<ul id="ssmenu{$nb}">
										{foreach $sub_items as $sub_item}
											<li><a href={$sub_item.url_alias|ezurl()}>{$sub_item.name}</a></li>
										{/foreach}
									</ul>
								{else}
									<a href={$item.url_alias|ezurl()}>{$item.name}</a>
								{/if}
								
								{set $nb=$nb|inc}
								{undef $sub_items}
							{/if}
						</li>
					{/foreach}
				</ul>
			{/if}
			</li>
			</ul>

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.