You are here

function _video_db_increase_timeout in Video 6.5

Same name and namespace in other branches
  1. 6.4 video.module \_video_db_increase_timeout()

Increase the database timeout in preparation for long time operations

Examples of such operations are S3 uploads and local transcoding.

Reconnecting to the database after this operation is not possible due to the way db_set_active stores the connection identifiers.

At this moment, only mysqli and mysql are handled. The timeout is set to 1 day

2 calls to _video_db_increase_timeout()
video_amazon_s3::pushFile in plugins/video_s3/video_s3.lib.inc
video_localcommand::convert_video in transcoders/video_localcommand.inc
Convert the given video.

File

./video.module, line 563
Main file of the Video module.

Code

function _video_db_increase_timeout() {
  global $db_type;
  if ($db_type === 'mysqli' || $db_type === 'mysql') {
    $timeout = 24 * 60 * 60;

    // one day
    db_query('SET SESSION wait_timeout = %d', $timeout);
  }
}