Don't set the pconfig values on manual mode
This commit is contained in:
parent
37d5bc1a51
commit
ec3eead034
|
@ -58,8 +58,7 @@ class Delayed
|
||||||
$last_publish = DI::pConfig()->get($item['uid'], 'system', 'last_publish', 0, true);
|
$last_publish = DI::pConfig()->get($item['uid'], 'system', 'last_publish', 0, true);
|
||||||
$next_publish = max($last_publish + (60 * $min_posting), time());
|
$next_publish = max($last_publish + (60 * $min_posting), time());
|
||||||
$delayed = date(DateTimeFormat::MYSQL, $next_publish);
|
$delayed = date(DateTimeFormat::MYSQL, $next_publish);
|
||||||
} else {
|
DI::pConfig()->set($item['uid'], 'system', 'last_publish', $next_publish);
|
||||||
$next_publish = strtotime($delayed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::notice('Adding post for delayed publishing', ['uid' => $item['uid'], 'delayed' => $delayed, 'uri' => $uri]);
|
Logger::notice('Adding post for delayed publishing', ['uid' => $item['uid'], 'delayed' => $delayed, 'uri' => $uri]);
|
||||||
|
@ -69,8 +68,6 @@ class Delayed
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::pConfig()->set($item['uid'], 'system', 'last_publish', $next_publish);
|
|
||||||
|
|
||||||
$delayed_post = [
|
$delayed_post = [
|
||||||
'uri' => $uri,
|
'uri' => $uri,
|
||||||
'uid' => $item['uid'],
|
'uid' => $item['uid'],
|
||||||
|
|
|
@ -601,7 +601,9 @@ class Feed
|
||||||
}
|
}
|
||||||
$publish_at = date(DateTimeFormat::MYSQL, $publish_time);
|
$publish_at = date(DateTimeFormat::MYSQL, $publish_time);
|
||||||
|
|
||||||
Post\Delayed::add($posting['item']['uri'], $posting['item'], $posting['notify'], false, $publish_at, $posting['taglist'], $posting['attachments']);
|
if (Post\Delayed::add($posting['item']['uri'], $posting['item'], $posting['notify'], false, $publish_at, $posting['taglist'], $posting['attachments'])) {
|
||||||
|
DI::pConfig()->set($item['uid'], 'system', 'last_publish', $publish_time);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue