Skip to content

Commit

Permalink
Merge branch 'MDL-60707' of git://github.com/aolley/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
snake committed Nov 13, 2017
2 parents dbc5620 + 7f83e99 commit e105a75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions search/classes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ public function index($fullindex = false, $timelimit = 0, \progress_trace $progr
// Notify the engine that an area is starting.
$this->engine->area_index_starting($searcharea, $fullindex);

$indexingstart = time();
$indexingstart = (int)self::get_current_time();
$elapsed = self::get_current_time();

// This is used to store this component config.
Expand Down Expand Up @@ -751,7 +751,7 @@ public function index($fullindex = false, $timelimit = 0, \progress_trace $progr

// Store last index run once documents have been committed to the search engine.
set_config($varname . '_indexingstart', $indexingstart, $componentconfigname);
set_config($varname . '_indexingend', time(), $componentconfigname);
set_config($varname . '_indexingend', (int)self::get_current_time(), $componentconfigname);
set_config($varname . '_docsignored', $numdocsignored, $componentconfigname);
set_config($varname . '_docsprocessed', $numdocs, $componentconfigname);
set_config($varname . '_recordsprocessed', $numrecords, $componentconfigname);
Expand Down
3 changes: 3 additions & 0 deletions search/tests/manager_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ public function test_partial_indexing() {
$this->assertEquals('Frog', $added[0]->get('title'));
$this->assertEquals('Toad', $added[1]->get('title'));
$this->assertEquals(1, get_config($componentname, $varname . '_partial'));
// Whilst 2.4 seconds of "time" have elapsed, the indexing duration is
// measured in seconds, so should be 2.
$this->assertEquals(2, $searcharea->get_last_indexing_duration());

// Add a label.
$generator->create_module('label', ['course' => $course->id, 'intro' => 'Vampire']);
Expand Down

0 comments on commit e105a75

Please sign in to comment.