Limit "number of projects to scan at once" by time?

hass - April 14, 2009 - 23:01
Project:Localization server
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

How about removing the selectbox from admin/l10n_server/l10n_localpacks and replace this with a time based logic? I've re-used the logic that job_queue have implemented in linkchecker and this works great.

Here is an example:

<?php
  $result
= db_query("SELECT * FROM {foo}");
  while (
$foo = db_fetch_object($result)) {
   
// Execute time consuming process.

   
if ((timer_read('page') / 1000) > (ini_get('max_execution_time') / 2)) {
      break;
// Stop once we have used over half of the maximum execution time.
   
}
  }
?>

#1

Gábor Hojtsy - April 15, 2009 - 07:03

Unfortunately whatever we implement would still leave the possibility of dying in the middle of a parsing phase. Even just one parsing phase can go over the execution time limits (we try very hard not to use lots of memory).

#2

hass - April 15, 2009 - 07:41

Yes, but if we have N small modules we are able to scan ~10-20 with one cron run in the half of the max execution time. I remember a few people complained in past that the import may takes years to complete... :-)

This is another module that would really benefit from a batch process that works via cron... not sure if someone already works on such a feature. I would really need this to for linkchecker, too.

#3

pvasili - August 9, 2009 - 19:34
Status:active» won't fix

Please don't touch this setting !
Each module has its own time (from 2-3 s up to 200 s or more)...

 
 

Drupal is a registered trademark of Dries Buytaert.