Skip to content

Commit

Permalink
Merge pull request #706 from aliasproject/latest
Browse files Browse the repository at this point in the history
set_time_limit should be set to zero for unlimited
  • Loading branch information
balexey88 authored Mar 21, 2024
2 parents 5e73078 + ac237c9 commit 661a9ce
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/classes/class-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function request() {
* Regenerate image sizes.
*/
public function action_stateless_process_image() {
@set_time_limit(-1);
set_time_limit(0);

$image = Utility::process_image_by_id(intval($_REQUEST['id']));

Expand All @@ -99,7 +99,7 @@ public function action_stateless_process_image() {
* @throws \Exception
*/
public function action_stateless_process_file() {
@set_time_limit(-1);
set_time_limit(0);

$file = Utility::process_file_by_id(intval($_REQUEST['id']));

Expand Down
2 changes: 1 addition & 1 deletion lib/classes/class-gs-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function list_all_objects($options = array()) {
public function add_media($args = array()) {
try {

@set_time_limit(-1);
set_time_limit(0);

$args = wp_parse_args($args, array(
'use_root' => true,
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/sync/class-file-sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function task($id) {
parent::before_task($id);

timer_start();
@set_time_limit(-1);
set_time_limit(0);

$file = Utility::process_file_by_id($id);
$this->log(sprintf(__('%1$s (ID %2$s) was successfully synced in %3$s seconds.', ud_get_stateless_media()->domain), esc_html(get_the_title($file->ID)), $file->ID, timer_stop()));
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/sync/class-image-sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function task($id) {
parent::before_task($id);

timer_start();
@set_time_limit(-1);
set_time_limit(0);

$image = Utility::process_image_by_id($id);
$this->log(sprintf(__('%1$s (ID %2$s) was successfully synced in %3$s seconds.', ud_get_stateless_media()->domain), esc_html(get_the_title($image->ID)), $image->ID, timer_stop()));
Expand Down
4 changes: 2 additions & 2 deletions lib/cli/class-sm-cli-sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function images() {

WP_CLI::line('Starting extract attachments.');

@set_time_limit(-1);
set_time_limit(0);

for ($this->start; $this->start < $this->end; $this->start += $this->limit) {

Expand Down Expand Up @@ -184,7 +184,7 @@ public function files() {

WP_CLI::line('Starting extract attachments.');

@set_time_limit(-1);
set_time_limit(0);

for ($this->start; $this->start < $this->end; $this->start += $this->limit) {

Expand Down

0 comments on commit 661a9ce

Please sign in to comment.