Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -46,16 +46,24 @@ class _DeleteLegacyPosts
|
||||
*/
|
||||
public function run( $data, $offset )
|
||||
{
|
||||
$select = \IPS\Db::i()->select( '*', 'forums_posts', 'queued > 2', 'pid ASC', array( 0, \IPS\REBUILD_NORMAL ) );
|
||||
$select = \IPS\Db::i()->select( '*', 'forums_posts', 'queued > 2', NULL, array( 0, \IPS\REBUILD_NORMAL ) );
|
||||
if ( !\count( $select ) )
|
||||
{
|
||||
throw new \IPS\Task\Queue\OutOfRangeException;
|
||||
}
|
||||
|
||||
$done = 0;
|
||||
foreach( new \IPS\Patterns\ActiveRecordIterator( $select, 'IPS\forums\Topic\Post' ) as $post )
|
||||
foreach( $select as $post )
|
||||
{
|
||||
$post->logDelete( FALSE );
|
||||
try
|
||||
{
|
||||
\IPS\forums\Topic\Post::constructFromData( $post )->logDelete( FALSE );
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
\IPS\Db::i()->update( 'forums_posts', [ 'queued' => '-1' ], [ 'pid=?', $post['pid'] ] );
|
||||
}
|
||||
|
||||
$done++;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user