Skip to content

Commit

Permalink
added throttling for auto-archive cronjob
Browse files Browse the repository at this point in the history
  • Loading branch information
following5 committed Jan 20, 2016
1 parent dca7e77 commit e861177
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions htdocs/util2/cron/modules/autoarchive_caches.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function archive_disabled_caches()
// For archiving caches that were disabled earlier, we also check the listing
// modification date.

// This statement shout be optimized. It typically runs for ~20 seconds at OC.de.
// This statement may be optimized. It typically runs for ~15 seconds at OC.de.
$rs = sql("
SELECT `cache_id`,
`caches`.`user_id`,
Expand Down Expand Up @@ -84,8 +84,11 @@ function archive_disabled_caches()
'maintain the cache and re-enable the listing.',
$months);
++$archived;
// if ($archived >= 3)
// break;

// This limit throttles archiving. If something goes wrong, it won't
// produce too much trouble.
if ($archived >= 10)
break;
}
}
sql_free_result($rs);
Expand Down

0 comments on commit e861177

Please sign in to comment.