Skip to content

Commit

Permalink
Create single Timer thread for all purge policies
Browse files Browse the repository at this point in the history
  • Loading branch information
earocorn committed Sep 13, 2024
1 parent 4004a7e commit 5a16531
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ protected void doStart() throws SensorHubException
{
throw new DataStoreException("Cannot instantiate underlying database " + config.dbConfig.moduleClass, e);
}

if(!config.autoPurgeConfig.isEmpty())
autoPurgeTimer = new Timer();

// start auto-purge timer thread if policy is specified and enabled
for(var autoPurgeConfig : config.autoPurgeConfig)
Expand All @@ -88,7 +91,6 @@ protected void doStart() throws SensorHubException
{
var uids = Collections.unmodifiableCollection(autoPurgeConfig.systemUIDs);
final IObsSystemDbAutoPurgePolicy policy = autoPurgeConfig.getPolicy();
autoPurgeTimer = new Timer();
TimerTask task = new TimerTask() {
public void run()
{
Expand Down

0 comments on commit 5a16531

Please sign in to comment.