Skip to content

Commit

Permalink
Merge branch 'MDL-58295-master' of git://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Apr 10, 2017
2 parents 7841e9f + 9d66980 commit 60b6e1b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion files/classes/converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ public function poll_conversion(conversion $conversion) {
// Unable to fetch the converter instance.
// Reset the status back to PENDING so that it may be picked up again.
$conversion->set('status', conversion::STATUS_PENDING);
$conversion->update();
}
$conversion->update();
}

// Refresh the status.
Expand All @@ -134,6 +134,7 @@ public function poll_conversion(conversion $conversion) {
if (!$currentconverter) {
// No more converters available.
$conversion->set('status', conversion::STATUS_FAILED);
$conversion->update();
return $this;
}

Expand Down
4 changes: 0 additions & 4 deletions files/converter/unoconv/classes/converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ public function start_document_conversion(\core_files\conversion $conversion) {
return $this;
}

// Update the status to IN_PROGRESS.
$conversion->set('status', \core_files\conversion::STATUS_IN_PROGRESS);
$conversion->update();

// Copy the file to the tmp dir.
$uniqdir = make_unique_writable_directory(make_temp_directory('core_file/conversions'));
\core_shutdown_manager::register_function('remove_dir', array($uniqdir));
Expand Down
2 changes: 2 additions & 0 deletions files/tests/converter_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ public function test_poll_conversion_in_progress() {
$conversion->set_sourcefile($file);
$conversion->set('targetformat', 'target');
$conversion->set('status', conversion::STATUS_IN_PROGRESS);
$conversion->create();

$converterinstance = $this->get_mocked_converter([
'poll_conversion_status',
Expand Down Expand Up @@ -484,6 +485,7 @@ public function test_poll_conversion_none_supported() {
'sourcefileid' => $file->get_id(),
'targetformat' => 'target',
]);
$conversion->create();

$converter->poll_conversion($conversion);

Expand Down

0 comments on commit 60b6e1b

Please sign in to comment.