Fixed Stats collection causes infinite loop during CLI upgrade

Steffen

Well-known member
Affected version
2.0.3
After having worked-around the CLI Upgrade Error by adding a dummy "__toString" method to the XF\Install\Language class, the upgrader went into an infinite loop. I've been able to break this loop by disabling the "Send anonymous server statistics" setting.

Code:
$ php cmd.php xf:upgrade --verbose
Current version: 2000370
Upgrade target: 2000370 (2.0.3)
You are already running the latest version. Rebuild the master data? [y/n] y
Importing... Master data (Templates)
Rebuilding... Templates . .

Rebuild completed successfully.

Running clean up tasks...
Language
collecting_server_stats
Array
1
Array
Language
collecting_server_stats
Array
1
Array
Language
collecting_server_stats
Array
1
Array
Language
collecting_server_stats
Array
1
Array
Language
collecting_server_stats
Array
1
Array
Language
...
 
This needs the following added to inside the XF\Cli\Runner job runner loop:
PHP:
if ($runner->continueDate)
{
   // job is finished but set to resume in the future
   break;
}
So if a job resumes, but specifies a continue date in the future, then we consider that one as finished for now.

That would be added directly below:
PHP:
$app->em()->clearEntityCache();
 
Top Bottom