PubSubHubbub prevent subscribing too often in case of error

https://github.com/FreshRSS/FreshRSS/issues/939
pull/940/head
Alexandre Alapetite 9 years ago
parent 422a9e161b
commit 9e43937f8c
  1. 9
      app/Models/Feed.php

@ -475,7 +475,14 @@ class FreshRSS_Feed extends Minz_Model {
file_put_contents($hubFilename, json_encode($hubJson));
}
return substr($info['http_code'], 0, 1) == '2';
if (substr($info['http_code'], 0, 1) == '2') {
return true;
} else {
$hubJson['lease_start'] = time(); //Prevent trying again too soon
$hubJson['error'] = true;
file_put_contents($hubFilename, json_encode($hubJson));
return false;
}
}
return false;
}

Loading…
Cancel
Save