Skip to content

Commit

Permalink
Merge branch 'MDL-71741-master' of git://github.com/HuongNV13/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Jun 3, 2021
2 parents 1edd0ac + 711d309 commit 95fed58
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
13 changes: 13 additions & 0 deletions lib/flickrclient.php
Expand Up @@ -235,6 +235,9 @@ public function upload(stored_file $photo, array $meta = []) {

$response = $this->http->post(self::UPLOAD_ROOT, $params);

// Reset http header and options to prepare for the next request.
$this->reset_state();

if ($response) {
$xml = simplexml_load_string($response);

Expand All @@ -254,4 +257,14 @@ public function upload(stored_file $photo, array $meta = []) {
throw new moodle_exception('flickr_upload_error', 'core_error', '', null, $response);
}
}

/**
* Resets curl state.
*
* @return void
*/
public function reset_state(): void {
$this->http->cleanopt();
$this->http->resetHeader();
}
}
12 changes: 6 additions & 6 deletions lib/portfoliolib.php
Expand Up @@ -1028,15 +1028,15 @@ function portfolio_filesize_info() {
function portfolio_expected_time_db($recordcount) {
global $CFG;

if (empty($CFG->portfolio_moderate_dbsize_threshold)) {
set_config('portfolio_moderate_dbsize_threshold', 10);
if (empty($CFG->portfolio_moderate_db_threshold)) {
set_config('portfolio_moderate_db_threshold', 20);
}
if (empty($CFG->portfolio_high_dbsize_threshold)) {
set_config('portfolio_high_dbsize_threshold', 50);
if (empty($CFG->portfolio_high_db_threshold)) {
set_config('portfolio_high_db_threshold', 50);
}
if ($recordcount < $CFG->portfolio_moderate_dbsize_threshold) {
if ($recordcount < $CFG->portfolio_moderate_db_threshold) {
return PORTFOLIO_TIME_LOW;
} else if ($recordcount < $CFG->portfolio_high_dbsize_threshold) {
} else if ($recordcount < $CFG->portfolio_high_db_threshold) {
return PORTFOLIO_TIME_MODERATE;
}
return PORTFOLIO_TIME_HIGH;
Expand Down

0 comments on commit 95fed58

Please sign in to comment.