mirror of
https://github.com/friendica/friendica
synced 2024-12-23 06:40:15 +00:00
Improve performance of settings save by not querying the DB if submitted value is the same
This commit is contained in:
parent
c168d7d4ca
commit
62bd32c1ac
2 changed files with 8 additions and 0 deletions
|
@ -126,6 +126,10 @@ class Config {
|
|||
public static function set($family, $key, $value) {
|
||||
global $a;
|
||||
|
||||
if (self::get($family, $key) === $value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$a->config[$family][$key] = $value;
|
||||
|
||||
// manage array value
|
||||
|
|
|
@ -123,6 +123,10 @@ class PConfig {
|
|||
|
||||
global $a;
|
||||
|
||||
if (self::get($uid, $family, $key) === $value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// manage array value
|
||||
$dbvalue = (is_array($value)?serialize($value):$value);
|
||||
|
||||
|
|
Loading…
Reference in a new issue