Fix cron_maintain

- Update profile before fetching scrape url
- Honor $parms['hide'] before validating dfrn site
- Fetch maintenance items oldest first
- Add backlog size in log
- Add pid to logger for easier threaded cron debug
This commit is contained in:
Hypolite Petovan 2017-10-22 23:48:00 -04:00
commit b833a8d255
3 changed files with 34 additions and 13 deletions

View file

@ -29,6 +29,14 @@ function run_submit($url) {
if(count($r)) {
$profile_exists = true;
$profile_id = $r[0]['id'];
$r = q("UPDATE `profile` SET
`updated` = '%s'
WHERE `id` = %d LIMIT 1",
dbesc(datetime_convert()),
intval($profile_id)
);
}
//Remove duplicates.
@ -86,19 +94,21 @@ function run_submit($url) {
nuke_record($url);
return true; //This is a good update.
}
//This is most likely a problem with the site configuration. Ignore.
elseif(validate_dfrn($parms)) {
return false;
}
if((x($parms,'hide')) || (! (x($parms,'fn')) && (x($parms,'photo')))) {
if($profile_exists) {
logger('Profile inferred to be opted out of the directory.');
nuke_record($url);
}
return true; //This is a good update.
}
//This is most likely a problem with the site configuration. Ignore.
if(validate_dfrn($parms)) {
logger('Site is unavailable');
return false;
}
$photo = $parms['photo'];
dbesc_array($parms);