Jump to content

Queue issues


newbie LAC

Recommended Posts

Posted

Hello,

system/Task/Task.php

		if ( method_exists( $extensions[ $key ], 'preQueueData' ) )
		{
			$class = new $extensions[ $key ];
			$data = $class->preQueueData( $data );
			if ( $data === NULL )
			{
				return;
			}
		}

Based on DocBlock the method preQueueData() should return an array

	/**
	 * Parse data before queuing
	 *
	 * @param	array	$data
	 * @return	array
	 */
	public function preQueueData( $data )

Ok. You allow to return NULL as you do in some background tasks.

But a queue will not be run (added into core_queue table) and the method postComplete() will not be executed.

Examples

- applications/core/extensions/core/Queue/RebuildContainerCounts.php

- applications/core/extensions/core/Queue/RebuildItemCounts.php

	public function postComplete( $data )
	{
		/* Clear guest cache */
		\IPS\Db::i()->delete( 'core_cache' );
	}

- applications/gallery/extensions/core/Queue/CleanUpGalleryImages.php

	public function postComplete( $data )
	{
		\IPS\Db::i()->query( "ALTER TABLE `" . \IPS\Db::i()->prefix . "gallery_images` DROP COLUMN image_thumb_file_name, DROP COLUMN image_medium_file_name" );
	}

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...