Logger::notice('Post stored', ['id' => $id, 'uid' => $item['uid'], 'cid' => $item['contact-id']]);
- // It should always contain an URI since this is needed to create a delayed post entry
if (!empty($item['uri']) && self::exists($item['uri'], $item['uid'])) {
- $result = self::delete($item['uri'], $item['uid']);
- Logger::notice('Delayed post entry deleted', ['result' => $result, 'uri' => $item['uri']]);
+ self::delete($item['uri'], $item['uid']);
}
if (!empty($id) && (!empty($taglist) || !empty($attachments))) {
'taglist' => $taglist, 'attachments' => $attachments];
}
} else {
- Logger::info('Post already crated or exists in the delayed posts queue', ['uri' => $item["uri"]]);
+ Logger::info('Post already crated or exists in the delayed posts queue', ['uid' => $item['uid'], 'uri' => $item["uri"]]);
}
}
// Posts shouldn't be delayed more than a day
$interval = min(1440, self::getPollInterval($contact));
$delay = max(round(($interval * 60) / $total), 60 * $min_posting);
- Logger::notice('Got posting delay', ['delay' => $delay, 'interval' => $interval, 'items' => $total, 'cid' => $contact['id'], 'url' => $contact['url']]);
+ Logger::info('Got posting delay', ['delay' => $delay, 'interval' => $interval, 'items' => $total, 'cid' => $contact['id'], 'url' => $contact['url']]);
} else {
$delay = 0;
}
foreach ($postings as $posting) {
if ($delay > 0) {
$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);
$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),
- 'uid' => $posting['item']['uid'], 'cid' => $posting['item']['contact-id'],
- 'uri' => $posting['item']["uri"]]);
$publish_time = $next_publish;
}
$publish_at = date(DateTimeFormat::MYSQL, $publish_time);