<commit_before><?php
namespace wcf\action;
use wcf\system\background\BackgroundQueueHandler;

/**
 * Performs background queue jobs.
 * 
 * @author	<NAME>
 * @copyright	2001-2019 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\Action
 * @since	3.0
 */
class BackgroundQueuePerformAction extends AbstractAction {
	/**
	 * number of jobs that will be processed per invocation
	 * @var integer
	 */
	public static $jobsPerRun = 5;
	
	/**
	 * @inheritDoc
	 */
	public function execute() {
		parent::execute();
		
		header('Content-type: application/json');
		for ($i = 0; $i < self::$jobsPerRun; $i++) {
			if (BackgroundQueueHandler::getInstance()->performNextJob() === false) {
				// there were no more jobs
				break;
			}
		}
		echo BackgroundQueueHandler::getInstance()->getRunnableCount();
		exit;
	}
}
<commit_msg>Delete firstVisit = true, userID = 0 sessions after processing background queue<commit_after><?php
namespace wcf\action;
use wcf\system\background\BackgroundQueueHandler;
use wcf\system\WCF;

/**
 * Performs background queue jobs.
 * 
 * @author	<NAME>
 * @copyright	2001-2019 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\Action
 * @since	3.0
 */
class BackgroundQueuePerformAction extends AbstractAction {
	/**
	 * number of jobs that will be processed per invocation
	 * @var integer
	 */
	public static $jobsPerRun = 5;
	
	/**
	 * @inheritDoc
	 */
	public function execute() {
		parent::execute();
		
		header('Content-type: application/json');
		for ($i = 0; $i < self::$jobsPerRun; $i++) {
			if (BackgroundQueueHandler::getInstance()->performNextJob() === false) {
				// there were no more jobs
				break;
			}
		}
		echo BackgroundQueueHandler::getInstance()->getRunnableCount();
		if (WCF::getSession()->isFirstVisit() && !WCF::getUser()->userID) {
			WCF::getSession()->delete();
		}
		exit;
	}
}

{'fraction_non_alphanumeric': 0.14328358208955225, 'fraction_numerical': 0.012437810945273632, 'mean_word_length': 4.040100250626566, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6347924', 'n_tokens_mistral': 701, 'n_tokens_neox': 609, 'n_words': 155}