From 04cd9f4d14111b6d568a8ddd7e5501873276b339 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 28 Dec 2020 10:29:02 -0800 Subject: No query caching --- src/main/java/org/traccar/config/Config.java | 9 ++------- src/main/java/org/traccar/database/DataManager.java | 8 ++------ 2 files changed, 4 insertions(+), 13 deletions(-) (limited to 'src/main/java/org/traccar') diff --git a/src/main/java/org/traccar/config/Config.java b/src/main/java/org/traccar/config/Config.java index 6c8ebb689..77184a528 100644 --- a/src/main/java/org/traccar/config/Config.java +++ b/src/main/java/org/traccar/config/Config.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2019 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2020 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -146,12 +146,7 @@ public class Config { } public void setString(ConfigKey key, String value) { - setString(key.getKey(), value); - } - - @Deprecated - public void setString(String key, String value) { - properties.put(key, value); + properties.put(key.getKey(), value); } static String getEnvironmentVariableName(String key) { diff --git a/src/main/java/org/traccar/database/DataManager.java b/src/main/java/org/traccar/database/DataManager.java index bd1c77520..d3a643c2e 100644 --- a/src/main/java/org/traccar/database/DataManager.java +++ b/src/main/java/org/traccar/database/DataManager.java @@ -224,12 +224,10 @@ public class DataManager { if (query == null) { if (generateQueries) { query = constructObjectQuery(action, clazz, extended); - config.setString(queryName, query); } else { LOGGER.info("Query not provided: " + queryName); } } - return query; } @@ -249,14 +247,12 @@ public class DataManager { String query = config.getString(queryName); if (query == null) { if (generateQueries) { - query = constructPermissionQuery(action, owner, - property.equals(User.class) ? ManagedUser.class : property); - config.setString(queryName, query); + query = constructPermissionQuery( + action, owner, property.equals(User.class) ? ManagedUser.class : property); } else { LOGGER.info("Query not provided: " + queryName); } } - return query; } -- cgit v1.2.3