includes/class-fs-api.php
private function _call( $path, $method = 'GET', $params = array(), $retry = false ) {
			$this->_logger->entrance( $method . ':' . $path );

			if ( self::is_temporary_down() ) {
				$result = $this->get_temporary_unavailable_error();
			} else {
				$result = $this->_api->Api( $path, $method, $params );

				if ( null !== $result &&
				     isset( $result->error ) &&
				     isset( $result->error->code ) &&
				     'request_expired' === $result->error->code
				) {
					if ( ! $retry ) {
						$diff = isset( $result->error->timestamp ) ?
							( time() - strtotime( $result->error->timestamp ) ) :
							false;

						// Try to sync clock diff.
						if ( false !== $this->_sync_clock_diff( $diff ) ) {
							// Retry call with new synced clock.
							return $this->_call( $path, $method, $params, true );
						}
					}
				}
			}

			if ( $this->_logger->is_on() && self::is_api_error( $result ) ) {
				// Log API errors.
				$this->_logger->api_error( $result );
			}

			return $result;
		}
private function _call( $path, $method = 'GET', $params = array(), $retry = false ) {
			$this->_logger->entrance( $method . ':' . $path );

			if ( self::is_temporary_down() ) {
				$result = $this->get_temporary_unavailable_error();
			} else {
				$result = $this->_api->Api( $path, $method, $params );

				if ( null !== $result &&
				     isset( $result->error ) &&
				     isset( $result->error->code ) &&
				     'request_expired' === $result->error->code
				) {
					if ( ! $retry ) {
						$diff = isset( $result->error->timestamp ) ?
							( time() - strtotime( $result->error->timestamp ) ) :
							false;

						// Try to sync clock diff.
						if ( false !== $this->_sync_clock_diff( $diff ) ) {
							// Retry call with new synced clock.
							return $this->_call( $path, $method, $params, true );
						}
					}
				}
			}

			if ( $this->_logger->is_on() && self::is_api_error( $result ) ) {
				// Log API errors.
				$this->_logger->api_error( $result );
			}

			return $result;
		}
private function _call ( $ path , $ method = 'GET' , $ params = array ( ) , $ retry = false ) { $ this -> _logger -> entrance ( $ method . ':' . $ path ) ; if ( self :: is_temporary_down ( ) ) { $ result = $ this -> get_temporary_unavailable_error ( ) ; } else { $ result = $ this -> _api -> Api ( $ path , $ method , $ params ) ; if ( null !== $ result && isset ( $ result -> error ) && isset ( $ result -> error -> code ) && 'request_expired' === $ result -> error -> code ) { if ( ! $ retry ) { $ diff = isset ( $ result -> error -> timestamp ) ? ( time ( ) - strtotime ( $ result -> error -> timestamp ) ) : false ; // Try to sync clock diff.
 if ( false !== $ this -> _sync_clock_diff ( $ diff ) ) { // Retry call with new synced clock.
 return $ this -> _call ( $ path , $ method , $ params , true ) ; } } } } if ( $ this -> _logger -> is_on ( ) && self :: is_api_error ( $ result ) ) { // Log API errors.
 $ this -> _logger -> api_error ( $ result ) ; } return $ result ; }
Override API call to enable retry with servers' clock auto sync method.

@param string $path
@param string $method
@param array  $params
@param bool   $retry Is in retry or first call attempt.

@return array|mixed|string|void
Override API call to enable retry with servers clock auto sync method .