Skip to content

Commit 6591230

Browse files
committed
[DB] Catch exception thrown by purge policy to prevent timer thread to
stop
1 parent 9d80363 commit 6591230

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,15 @@ protected void doStart() throws SensorHubException
9494
TimerTask task = new TimerTask() {
9595
public void run()
9696
{
97-
if (!db.isReadOnly())
98-
policy.trimStorage(db, logger, uids);
97+
try
98+
{
99+
if (!db.isReadOnly())
100+
policy.trimStorage(db, logger, uids);
101+
}
102+
catch (Exception e)
103+
{
104+
getLogger().error("Error while executing purge policy", e);
105+
}
99106
}
100107
};
101108

0 commit comments

Comments
 (0)