From 945d3cc048564d80e29144b9ab640fd7ecd410b5 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 3 Jun 2017 19:46:19 +0000 Subject: [PATCH 1/2] The constant CURLE_OPERATION_TIMEDOUT isn't defined on older PHP versions --- boot.php | 9 ++++++++- database.sql | 3 ++- include/dbstructure.php | 1 + update.php | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/boot.php b/boot.php index 0f93c5e6d..f9f8794e5 100644 --- a/boot.php +++ b/boot.php @@ -40,7 +40,7 @@ define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_CODENAME', 'Asparagus'); define ( 'FRIENDICA_VERSION', '3.5.2-rc' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1226 ); +define ( 'DB_UPDATE_VERSION', 1227 ); /** * @brief Constant with a HTML line break. @@ -457,6 +457,13 @@ if (!defined("SIGTERM")) { define("SIGTERM", 15); } +/** + * Depending on the PHP version this constant does exist - or not. + * See here: http://php.net/manual/en/curl.constants.php#117928 + */ +if (!defined('CURLE_OPERATION_TIMEDOUT')) { + define('CURLE_OPERATION_TIMEDOUT', CURLE_OPERATION_TIMEOUTED); +} /** * * Reverse the effect of magic_quotes_gpc if it is enabled. diff --git a/database.sql b/database.sql index 2b40552eb..4a5946ef3 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 3.5.2-rc (Asparagus) --- DB_UPDATE_VERSION 1226 +-- DB_UPDATE_VERSION 1227 -- ------------------------------------------ @@ -1115,6 +1115,7 @@ CREATE TABLE IF NOT EXISTS `workerqueue` ( `pid` int(11) NOT NULL DEFAULT 0, `executed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', PRIMARY KEY(`id`), + INDEX `pid` (`pid`), INDEX `priority_created` (`priority`,`created`) ) DEFAULT COLLATE utf8mb4_general_ci; diff --git a/include/dbstructure.php b/include/dbstructure.php index 441e7be7f..1daf042d5 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -1742,6 +1742,7 @@ function db_definition() { ), "indexes" => array( "PRIMARY" => array("id"), + "pid" => array("pid"), "priority_created" => array("priority", "created"), ) ); diff --git a/update.php b/update.php index 695ed3991..7561a9af1 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ Date: Sun, 4 Jun 2017 09:00:07 +0000 Subject: [PATCH 2/2] It should be "e" not "p" --- include/poller.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/poller.php b/include/poller.php index 22fb65a4f..ed870c358 100644 --- a/include/poller.php +++ b/include/poller.php @@ -545,7 +545,7 @@ function poller_worker_process() { $highest_priority = 0; if (poller_passing_slow($highest_priority)) { - dba::p('LOCK TABLES `workerqueue` WRITE'); + dba::e('LOCK TABLES `workerqueue` WRITE'); // Are there waiting processes with a higher priority than the currently highest? $r = q("SELECT * FROM `workerqueue` @@ -567,7 +567,7 @@ function poller_worker_process() { return $r; } } else { - dba::p('LOCK TABLES `workerqueue` WRITE'); + dba::e('LOCK TABLES `workerqueue` WRITE'); } // If there is no result (or we shouldn't pass lower processes) we check without priority limit @@ -577,7 +577,7 @@ function poller_worker_process() { // We only unlock the tables here, when we got no data if (!dbm::is_result($r)) { - dba::p('UNLOCK TABLES'); + dba::e('UNLOCK TABLES'); } return $r; @@ -597,7 +597,7 @@ function poller_claim_process($queue) { $success = dba::update('workerqueue', array('executed' => datetime_convert(), 'pid' => $mypid), array('id' => $queue["id"], 'pid' => 0)); - dba::p('UNLOCK TABLES'); + dba::e('UNLOCK TABLES'); if (!$success) { logger("Couldn't update queue entry ".$queue["id"]." - skip this execution", LOGGER_DEBUG);