Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -38,23 +38,26 @@ class _Upgrade
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_notifications', array( 'notification_key = ?', 'new_private_message' ), 'id ASC', array( $limit, $perCycle ) ) as $row )
|
||||
if( \IPS\Db::i()->select( 'COUNT(*)', 'core_notifications' )->first() )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
$did++;
|
||||
|
||||
try
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_notifications', array( 'notification_key = ?', 'new_private_message' ), 'id ASC', array( $limit, $perCycle ) ) as $row )
|
||||
{
|
||||
$message = \IPS\core\Messenger\Message::load( $row['item_sub_id'] );
|
||||
$conversation = $message->item();
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
\IPS\Db::i()->update( 'core_notifications', array( 'item_class' => 'IPS\core\Messenger\Conversation', 'item_id' => $conversation->id ), array( 'id=?', $row['id'] ) );
|
||||
$did++;
|
||||
|
||||
try
|
||||
{
|
||||
$message = \IPS\core\Messenger\Message::load( $row['item_sub_id'] );
|
||||
$conversation = $message->item();
|
||||
|
||||
\IPS\Db::i()->update( 'core_notifications', array( 'item_class' => 'IPS\core\Messenger\Conversation', 'item_id' => $conversation->id ), array( 'id=?', $row['id'] ) );
|
||||
}
|
||||
catch( \Exception $e ) {}
|
||||
}
|
||||
catch( \Exception $e ) {}
|
||||
}
|
||||
|
||||
if( $did )
|
||||
|
||||
Reference in new issue
Block a user