Commit aee61e54 authored by dmorley's avatar dmorley

Merge branch 'remote-pull-ease' into 'develop'

Remote pull ease

See merge request !238
parents b074a132 47f116a1
Pipeline #1460 passed with stage
in 2 minutes and 46 seconds
......@@ -4,6 +4,7 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic
## [Unreleased]
### Added
### Changed
- only check pods once a month found in the wild via crawl
- curl function timeout can be changed from 15 second default
### Deprecated
### Removed
......
......@@ -133,5 +133,6 @@ if (!$stop) {
echo 'Data successfully inserted! Your pod will be checked and live on the list in a few hours!';
} else {
echo 'Could not validate your pod, check your setup!<br>Take a look at your <a href="' . $nodeinfo_url . '">nodeinfo</a>';
updateMeta('add_attempt', $_domain);
}
}
......@@ -28,6 +28,22 @@ try {
//get all existing pod domains
$existingpods = array_column($pods, 'domain');
//get pods we have not tried to auto add for a while
try {
$sql = '
SELECT value
FROM meta
WHERE date_created > now() - interval \'1 month\'
AND name = \'add_attempt\'
';
$metaresult = R::getAll($sql);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
}
$triedpods = array_column($metaresult, 'value');
$skippods = array_merge($existingpods, $triedpods);
$foundpods = [];
//pulling all nodes for now
......@@ -46,7 +62,7 @@ if ($pods = json_decode($diasppods['body'] ?: '', true)) {
}
}
$results = array_diff($foundpods, $existingpods);
$results = array_diff($foundpods, $skippods);
foreach ($results as $result) {
echo ' domain ' . $result . ' trying... ';
$add = __DIR__ . '/add.php';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment