Skip to content

Commit

Permalink
Github CI/CD doesn't allow set_time_limit so cope with that
Browse files Browse the repository at this point in the history
  • Loading branch information
bakert committed Oct 31, 2024
1 parent 447eff6 commit 7e844ac
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
8 changes: 7 additions & 1 deletion gatherling/admin/db-upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@

use Gatherling\Data\Setup;

use function Gatherling\Helpers\logger;
use function Gatherling\Helpers\server;
use function Safe\set_time_limit;

require_once __DIR__ . '/../lib.php';

set_time_limit(0);
try {
set_time_limit(0);
} catch (\Exception $e) {
// set_time_limit is not allowed here but we'll try our best to complete in time.
logger()->warning('Failed to set time limit, trying anyway: ' . $e->getMessage());
}

function main(): never
{
Expand Down
12 changes: 9 additions & 3 deletions gatherling/insertcardset.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@
use Gatherling\Views\Redirect;

use function Gatherling\Helpers\files;
use function Gatherling\Helpers\logger;
use function Gatherling\Helpers\request;
use function Gatherling\Helpers\server;
use function Safe\set_time_limit;

set_time_limit(0);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);

require_once __DIR__ . '/lib.php';

try {
set_time_limit(0);
} catch (\Exception $e) {
// set_time_limit is not allowed here but we'll try our best to complete in time.
logger()->warning('Failed to set time limit, running anyway: ' . $e->getMessage());
}
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);

function main(): never
{
global $argv;
Expand Down
9 changes: 7 additions & 2 deletions gatherling/util/updateDefaultFormats.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@
use function Gatherling\Helpers\server;
use function Safe\set_time_limit;

set_time_limit(0);

require_once __DIR__ . '/../lib.php';

try {
set_time_limit(0);
} catch (\Exception $e) {
// set_time_limit is not allowed here but we'll try our best to complete in time.
logger()->warning('Failed to set time limit, running anyway: ' . $e->getMessage());
}

function main(): never
{
if (PHP_SAPI != 'cli' && $_SERVER['REQUEST_METHOD'] == 'GET') { // unauthorized POST is okay
Expand Down

0 comments on commit 7e844ac

Please sign in to comment.