Jump to content

Queue task return offset bad comparison


BomAle
 Share

Go to solution Solved by BomAle,

Recommended Posts

I would suggest to improve following code:

#system/Task/Task.php:64-79
/* Task completed successfully and a new offset was returned - store the value and then return it */
/*....*/
$newData = json_encode( $json );
				
/* Did it change?? */
if ( $newData !== $json )
{
	$queueData['data'] = $newData;
	\IPS\Db::i()->update( 'core_queue', array( 'data' => $newData ), array( 'id=?', $queueData['id'] ) );
}

FIX: $newData !== $queueData['data']

tested with 4.3.1

Link to comment
Share on other sites

  • Solution
1 hour ago, bfarber said:

Can you say why?

string is not equal to object, and also if you do

$newData !== json_encode($json)

it is a no sense, the purpose is another (compare new data with older changed by Reference after "run" is called)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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