Version 4.7.23
This commit is contained in:
1 parent
7124a02564
commit
25ddeb65d6
1791 files changed
+76990
-44452
No files matched your search
@@ -65,6 +65,7 @@ class _Subscription extends \IPS\Patterns\ActiveRecord
|
||||
*/
|
||||
public static function sendBatch( $frequency = 'daily', $numberToSend = 25 )
|
||||
{
|
||||
/* @note SELECT_FROM_WRITE_SERVER to prevent further cycles from having data on the write but not read servers */
|
||||
$subscriptions = iterator_to_array(
|
||||
\IPS\Db::i()->select( 'core_stream_subscriptions.*, core_members.last_visit', 'core_stream_subscriptions', array('frequency = ? AND sent < ? and last_visit > ?', $frequency, ( $frequency == 'daily' ) ? time() - 86400 : time() - 604800, time() - \IPS\Settings::i()->activity_stream_subscriptions_inactive_limit * 86400), 'sent ASC', array(0, $numberToSend), NULL, NULL, \IPS\Db::SELECT_DISTINCT | \IPS\Db::SELECT_FROM_WRITE_SERVER )
|
||||
->join( 'core_members', 'core_stream_subscriptions.member_id=core_members.member_id') );
|
||||
@@ -174,7 +175,9 @@ class _Subscription extends \IPS\Patterns\ActiveRecord
|
||||
$containerUrl = $containerClass::urlFromIndexData( $data['indexData'], $data['itemData'], $data['containerData'] );
|
||||
}
|
||||
|
||||
$items[] = array_merge($data, [
|
||||
try
|
||||
{
|
||||
$items[] = array_merge($data, [
|
||||
'title' => $object instanceof \IPS\Content\Comment ? $object->item()->searchIndexTitle() : $object->searchIndexTitle(),
|
||||
'url' => $object->url(),
|
||||
'content' => $object->content(),
|
||||
@@ -183,7 +186,13 @@ class _Subscription extends \IPS\Patterns\ActiveRecord
|
||||
'itemClass' => $itemClass,
|
||||
'containerUrl' => $containerUrl,
|
||||
'containerTitle' => $containerTitle
|
||||
]);
|
||||
]);
|
||||
}
|
||||
catch( \OutOfRangeException|\BadMethodCallException $e )
|
||||
{
|
||||
/* If the item is no longer available, we'll just skip it */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $items;
|
||||
|
||||
Reference in new issue
Block a user