Plugin Directory

Changeset 562704


Ignore:
Timestamp:
06/22/2012 09:46:06 PM (13 years ago)
Author:
hel.io
Message:

Fixed resumable checking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • backup/trunk/backup.php

    r562699 r562704  
    863863                $id = $this->gdocs->upload_file($file_path, $file_name, $this->options['drive_folder']);
    864864                if ( is_wp_error($id) ) {
    865                     $err = $id->get_error_message('resumable');
    866                     if ( ! empty($err) ) { // If we are here it means we have a chance at resuming the download so schedule resume.
    867                         $this->log("WARNING", $err . ' The upload speed was around ' . size_format( $this->gdocs->get_upload_speed() ) . '/s.');
     865                    if ( $this->gdocs->is_resumable() ) { // If we are here it means we have a chance at resuming the download so schedule resume.
     866                        $this->log("WARNING", $id->get_error_message() . ' The upload speed was around ' . size_format( $this->gdocs->get_upload_speed() ) . '/s.');
    868867                        wp_schedule_single_event($this->time, 'backup_resume');
    869868                    }
     
    928927        $id   = $this->gdocs->resume_upload();
    929928        if ( is_wp_error($id) ) {
    930             $err = $id->get_error_message('resumable');
    931             if ( ! empty($err) ) {
    932                 $this->log("WARNING", $err . ' The upload speed was around ' . size_format( $this->gdocs->get_upload_speed() ) . '/s.');
     929            if ( $this->is_resumable() ) {
     930                $this->log("WARNING", $id->get_error_message() . ' The upload speed was around ' . size_format( $this->gdocs->get_upload_speed() ) . '/s.');
    933931                wp_schedule_single_event($this->time, 'backup_resume');
    934932            }
Note: See TracChangeset for help on using the changeset viewer.