Only delay mirrored feeds
This commit is contained in:
parent
b2dadf0f92
commit
e9fecf1541
|
@ -638,22 +638,24 @@ class Feed
|
||||||
$post_delay = 0;
|
$post_delay = 0;
|
||||||
|
|
||||||
foreach ($postings as $posting) {
|
foreach ($postings as $posting) {
|
||||||
if ($delay > 0) {
|
$publish_time = time();
|
||||||
$publish_time = time() + $post_delay;
|
|
||||||
Logger::notice('Got publishing date', ['delay' => $delay, 'cid' => $contact['id'], 'url' => $contact['url']]);
|
|
||||||
$post_delay += $delay;
|
|
||||||
} else {
|
|
||||||
$publish_time = time();
|
|
||||||
}
|
|
||||||
|
|
||||||
$last_publish = DI::pConfig()->get($posting['item']['uid'], 'system', 'last_publish', 0, true);
|
if ($posting['notify']) {
|
||||||
$next_publish = max($last_publish + (60 * $min_posting), time());
|
if ($delay > 0) {
|
||||||
if ($publish_time < $next_publish) {
|
$publish_time = time() + $post_delay;
|
||||||
Logger::notice('Adapting publish time',
|
Logger::notice('Got publishing date', ['delay' => $delay, 'cid' => $contact['id'], 'url' => $contact['url']]);
|
||||||
['last' => date(DateTimeFormat::MYSQL, $last_publish),
|
$post_delay += $delay;
|
||||||
'next' => date(DateTimeFormat::MYSQL, $next_publish),
|
}
|
||||||
'publish' => date(DateTimeFormat::MYSQL, $publish_time)]);
|
|
||||||
$publish_time = $next_publish;
|
$last_publish = DI::pConfig()->get($posting['item']['uid'], 'system', 'last_publish', 0, true);
|
||||||
|
$next_publish = max($last_publish + (60 * $min_posting), time());
|
||||||
|
if ($publish_time < $next_publish) {
|
||||||
|
Logger::notice('Adapting publish time',
|
||||||
|
['last' => date(DateTimeFormat::MYSQL, $last_publish),
|
||||||
|
'next' => date(DateTimeFormat::MYSQL, $next_publish),
|
||||||
|
'publish' => date(DateTimeFormat::MYSQL, $publish_time)]);
|
||||||
|
$publish_time = $next_publish;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$publish_at = date(DateTimeFormat::MYSQL, $publish_time);
|
$publish_at = date(DateTimeFormat::MYSQL, $publish_time);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue