Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions config.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,13 @@
* @var string|null
*/
const DEBUG_LOG = DATA_ROOT . '/debug.log';

/**
* DB_QUERY_RUNNING_TIME_LIMIT
* Set the maximum time in seconds a database query is allowed to run.
* If a query takes longer than this, it will be aborted and an error will be returned
*
* Default: 30
* @var int
*/
const DB_QUERY_RUNNING_TIME_LIMIT = 30;
1 change: 1 addition & 0 deletions server/_inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class UserException extends \Exception {}
'TITLE' => 'My oPodSync server',
'DEBUG_LOG' => null,
'HTTP_SCHEME' => !empty($_SERVER['HTTPS']) || $_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http',
'DB_QUERY_RUNNING_TIME_LIMIT' => 30,
];

foreach ($defaults as $const => $value) {
Expand Down
2 changes: 1 addition & 1 deletion server/lib/OPodSync/GPodder.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public function updateAllFeeds(bool $cli = false): void
$db = DB::getInstance();

foreach ($db->iterate($sql) as $row) {
@set_time_limit(30); // Extend running time;
@set_time_limit(DB_QUERY_RUNNING_TIME_LIMIT); // Extend running time;

if ($cli) {
printf("Updating %s\n", $row->url);
Expand Down