mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-05 20:26:16 +02:00
Cancelling timer at close to prevent attempts to commit closed DB.
Change-Id: I01d2984e69ea8329c06a6fc3610d4a419f9bd6a2
This commit is contained in:
parent
f25d2e0ac0
commit
dfb325a88e
@ -60,12 +60,13 @@ public class PersistenceManager implements PersistenceService {
|
||||
|
||||
private static final int FLUSH_FREQUENCY_MILLIS = 3000;
|
||||
|
||||
private final Timer timer = new Timer();
|
||||
private Timer timer;
|
||||
|
||||
private final CommitTask commitTask = new CommitTask();
|
||||
|
||||
@Activate
|
||||
public void activate() {
|
||||
timer = new Timer();
|
||||
Path dbPath = Paths.get(DATABASE_PATH);
|
||||
Path dbFolderPath = Paths.get(ENCLOSING_FOLDER);
|
||||
//Make sure the directory exists, if it does not, make it.
|
||||
@ -96,6 +97,7 @@ public class PersistenceManager implements PersistenceService {
|
||||
|
||||
@Deactivate
|
||||
public void deactivate() {
|
||||
timer.cancel();
|
||||
for (Map.Entry<String, Object> entry : localDB.getAll().entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user