From 1a595f4273360087661c3b07db5d38eae6e77247 Mon Sep 17 00:00:00 2001 From: nobody Date: Sun, 18 Oct 2020 17:59:41 -0700 Subject: [PATCH] hubloc_mark_as_down() - also set site_dead --- include/hubloc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/hubloc.php b/include/hubloc.php index d25a759b1..d74541d80 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -247,6 +247,7 @@ function hubloc_change_primary($hubloc) { * * We use the post url to distinguish between http and https hublocs. * The https might be alive, and the http dead. + * Also set site_dead for the corresponding entry in the site table * * @param string $posturl Hubloc callback url which to disable */ @@ -255,6 +256,12 @@ function hubloc_mark_as_down($posturl) { intval(HUBLOC_OFFLINE), dbesc($posturl) ); + // extract the baseurl and set site.site_dead to match + $m = parse_url($posturl); + $h = $m['scheme'] . '://' . $m['host']; + $r = q("update site set site_dead = 1 where site_url = '%s'", + dbesc($h) + ); }