Skip to content

Commit 080f5db

Browse files
committed
[Core] Fix to properly delete old FOIs
1 parent 69b4df1 commit 080f5db

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

sensorhub-core/src/main/java/org/sensorhub/impl/database/system/MaxAgeAutoPurgePolicy.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ public void trimStorage(IObsSystemDatabase db, Logger log, Collection<String> sy
6464
.withOperator(RangeOp.CONTAINS)
6565
.withRange(Instant.MIN, oldestRecordTime)
6666
.build())
67-
.withUniqueIDs(systemUIDs)
68-
.includeMembers(true)
67+
.withParents(new SystemFilter.Builder()
68+
.withUniqueIDs(systemUIDs)
69+
.includeMembers(true)
70+
.build())
6971
.build());
7072

7173
long numFoisRemoved = db.getFoiStore().removeEntries(new FoiFilter.Builder()
@@ -83,9 +85,9 @@ public void trimStorage(IObsSystemDatabase db, Logger log, Collection<String> sy
8385
.withRange(Instant.MIN, oldestRecordTime)
8486
.build())
8587
.withSystems(new SystemFilter.Builder()
86-
.withUniqueIDs(systemUIDs)
87-
.includeMembers(true)
88-
.build())
88+
.withUniqueIDs(systemUIDs)
89+
.includeMembers(true)
90+
.build())
8991
.build());
9092

9193
long numCsRemoved = db.getCommandStreamStore().removeEntries(new CommandStreamFilter.Builder()
@@ -94,9 +96,9 @@ public void trimStorage(IObsSystemDatabase db, Logger log, Collection<String> sy
9496
.withRange(Instant.MIN, oldestRecordTime)
9597
.build())
9698
.withSystems(new SystemFilter.Builder()
97-
.withUniqueIDs(systemUIDs)
98-
.includeMembers(true)
99-
.build())
99+
.withUniqueIDs(systemUIDs)
100+
.includeMembers(true)
101+
.build())
100102
.build());
101103

102104
// for each remaining datastream, remove all obs with a timestamp older than

0 commit comments

Comments
 (0)