Skip to content

Commit

Permalink
Automatically set time limit in all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Jan 2, 2022
1 parent a05e11c commit 0a41cd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/danog/MadelineProto/Magic.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ public static function start(bool $light = false): void
self::$can_getcwd = true;
} catch (\Throwable $e) {
}
try {
if (\function_exists('set_time_limit')) {
\set_time_limit(-1);
}
} catch (\Throwable $e) {
}
// Define signal handlers
if (\defined('SIGINT')) {
//if (function_exists('pcntl_async_signals')) pcntl_async_signals(true);
Expand Down
3 changes: 2 additions & 1 deletion src/danog/MadelineProto/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,8 @@ function () use ($var) {
public static function &getVar($obj, string $var)
{
return \Closure::bind(
function &() use ($var) {
function &() use ($var)
{
return $this->{$var};
},
$obj,
Expand Down

0 comments on commit 0a41cd8

Please sign in to comment.