Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public V call() throws Exception {

@Override
protected void done() {
this.save();
try {
this.save();
} finally {
super.done();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public V call() throws Exception {

@Override
protected void done() {
this.save();
try {
this.save();
} finally {
super.done();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.Date;
import java.util.concurrent.Callable;

import org.apache.tinkerpop.gremlin.structure.Transaction;
import org.slf4j.Logger;

import com.baidu.hugegraph.HugeException;
Expand All @@ -48,13 +49,20 @@ public TaskCallable() {
}

protected void done() {
// Do nothing, subclasses may override this method
this.closeTx();
}

protected void cancelled() {
// Do nothing, subclasses may override this method
}

protected void closeTx() {
Transaction tx = this.graph().tx();
if (tx.isOpen()) {
tx.close();
}
}

public void setMinSaveInterval(long seconds) {
E.checkArgument(seconds > 0,
"Must set interval > 0, bug got '%s'", seconds);
Expand Down