mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-24 13:44:20 +00:00
complete push API sender
This commit is contained in:
parent
f9a9933ee7
commit
5dd59df789
@ -309,6 +309,36 @@ if (API_EXPORT_PUSH_ENABLED)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip sending to non-condition addresses
|
||||||
|
if ($pushUrl = Yggverse\Parser\Url::parse($manifest->import->push))
|
||||||
|
{
|
||||||
|
if (!preg_match(YGGDRASIL_HOST_REGEX, str_replace(['[',']'], false, $pushUrl->host->name)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip sending to the current host
|
||||||
|
if ($thisUrl = Yggverse\Parser\Url::parse(WEBSITE_URL))
|
||||||
|
{
|
||||||
|
if ($pushUrl->host->name == $thisUrl->host->name) // @TODO some mirrors could be available, improve condition
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @TODO add recipient manifest check to not disturb API without needs
|
||||||
|
|
||||||
// Send push request
|
// Send push request
|
||||||
$debug['result'][$manifest->import->push]['request'] = $request;
|
$debug['result'][$manifest->import->push]['request'] = $request;
|
||||||
|
|
||||||
@ -324,11 +354,11 @@ if (API_EXPORT_PUSH_ENABLED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Drop processed item from queue
|
// Drop processed item from queue
|
||||||
// unset($memoryApiExportPush[$id]);
|
unset($memoryApiExportPush[$id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update memory pool
|
// Update memory pool
|
||||||
// $memory->set('api.export.push', $memoryApiExportPush);
|
$memory->set('api.export.push', $memoryApiExportPush);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export push disabled, free api.export.push pool
|
// Export push disabled, free api.export.push pool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user