Skip to content
Permalink
Browse files

fixed import of maintained GC waypoints; updates #341

and enabled manually running single cronjobs
  • Loading branch information...
following5 committed Jun 16, 2015
1 parent 33302e7 commit 95805da9bbf25110549b5ab105badf782a68a069
Showing with 28 additions and 4 deletions.
  1. +16 −0 htdocs/util2/cron/modules/gcwp_update.class.php
  2. +12 −4 htdocs/util2/cron/runcron.php
@@ -20,20 +20,36 @@ function run()
{
global $opt;
$ocwp_imported = array();
$errors = false;
foreach ($opt['cron']['gcwp']['sources'] as $source)
{
$wpdata = @file($source);
if ($wpdata === FALSE)
{
echo "gcwp_update: error reading " . $source . "\n";
$errors = true;
}
else
foreach ($wpdata as $line)
{
$waypoints = explode(",",trim($line));
if (count($waypoints) == 2)
{
sql("UPDATE `caches` SET `wp_gc_maintained`='&2' WHERE `wp_oc`='&1'",
$waypoints[0], $waypoints[1]);
$ocwp_imported[] = sql_escape($waypoints[0]);
}
}
}
if (!$errors)
sql("
UPDATE caches
SET wp_gc_maintained = UCASE(TRIM(wp_gc))
WHERE wp_oc NOT IN ('" . implode("','",$ocwp_imported) . "')"
);
}
}
@@ -32,10 +32,18 @@
$modules_dir = $opt['rootpath'] . 'util2/cron/modules/';
$hDir = opendir($modules_dir);
while (false !== ($file = readdir($hDir)))
if (substr($file, -10) == '.class.php')
require($modules_dir . $file);
if (count($argv) == 2 && !strstr("/", $argv[1]))
{
// run one job manually for debugging purpose
require($modules_dir . $argv[1] . ".class.php");
}
else
{
$hDir = opendir($modules_dir);
while (false !== ($file = readdir($hDir)))
if (substr($file, -10) == '.class.php')
require($modules_dir . $file);
}
$process_sync->Leave();
}

0 comments on commit 95805da

Please sign in to comment.
You can’t perform that action at this time.