LP#1901247: skip unnecessary user/ws setting updates when the value is unchanged... user/jeffdavis/lp1901247-skip-user-ws-setting-updates
authorJeff Davis <jeff.davis@bc.libraries.coop>
Fri, 23 Oct 2020 20:17:55 +0000 (13:17 -0700)
committerJeff Davis <jeff.davis@bc.libraries.coop>
Fri, 23 Oct 2020 20:17:55 +0000 (13:17 -0700)
Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop>
Open-ILS/src/eg2/src/app/core/server-store.service.ts

index b54a4c9..73e8465 100644 (file)
@@ -31,6 +31,11 @@ export class ServerStoreService {
             return Promise.reject('Auth required to apply settings');
         }
 
+        // skip update if setting is unchanged
+        if (this.cache[key] && this.cache[key] === value) {
+            return Promise.resolve();
+        }
+
         const setting: any = {};
         setting[key] = value;