aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-05-05 09:15:02 +0000
committerMario <mario@mariovavti.com>2021-05-05 09:15:02 +0000
commitaef035034639211587bda9b98ba46514dac409a4 (patch)
treeda028d9dfbc93ff1f2b8fad596b0f77b5456f9fe
parent83fbb0678c5cdb8d76cddecd39df490e092f47ad (diff)
downloadvolse-hubzilla-aef035034639211587bda9b98ba46514dac409a4.tar.gz
volse-hubzilla-aef035034639211587bda9b98ba46514dac409a4.tar.bz2
volse-hubzilla-aef035034639211587bda9b98ba46514dac409a4.zip
remove duplicate singletons hublocs once a day
-rw-r--r--Zotlabs/Daemon/Cron_daily.php1
-rw-r--r--include/hubloc.php3
2 files changed, 4 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Cron_daily.php b/Zotlabs/Daemon/Cron_daily.php
index 1983c68e6..bebccca9d 100644
--- a/Zotlabs/Daemon/Cron_daily.php
+++ b/Zotlabs/Daemon/Cron_daily.php
@@ -93,6 +93,7 @@ class Cron_daily {
Master::Summon(array('Cli_suggest'));
remove_obsolete_hublocs();
+ remove_duplicate_singleton_hublocs();
z6_discover();
diff --git a/include/hubloc.php b/include/hubloc.php
index 94d1af5f0..2cce7a725 100644
--- a/include/hubloc.php
+++ b/include/hubloc.php
@@ -175,8 +175,11 @@ function remove_obsolete_hublocs() {
/**
* @brief Remove duplicate singleton hublocs
*
+ * This should not actually happen but it appears it does - probably due to race conditions.
* This function will just leave the hubloc with the highest id (latest)
*
+ * TODO: we should probably do something about that at the DB level.
+ *
*/
function remove_duplicate_singleton_hublocs() {
$hublocs = dbq("SELECT hubloc_hash, COUNT(hubloc_hash) FROM hubloc WHERE