Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Jan N. Klug <[email protected]>
  • Loading branch information
J-N-K committed May 12, 2023
1 parent d9d9177 commit f65f5b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,16 @@ public void store(Item item, ZonedDateTime date, State state, @Nullable String a

@Override
public boolean remove(FilterCriteria filter) throws IllegalArgumentException {
if (filter.getItemName() == null) {
logger.warn("Item name is missing in filter {} when trying to remove data.", filter);
if (serviceActivated && checkConnection()) {
if (filter.getItemName() == null) {
logger.warn("Item name is missing in filter {} when trying to remove data.", filter);
return false;
}
return influxDBRepository.remove(filter);
} else {
logger.debug("Remove query {} ignored, InfluxDB is not connected.", filter);
return false;
}
return influxDBRepository.remove(filter);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public interface InfluxDBRepository {
* Execute delete query
*
* @param filter the query filter
* @return
* @return <code>true</code> if query executed successfully, <code>false</code> otherwise
*/
boolean remove(FilterCriteria filter);

Expand Down

0 comments on commit f65f5b6

Please sign in to comment.