Skip to content

Commit

Permalink
for #1172, refactor OpenTracingSQLExecutionHook
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Sep 25, 2018
1 parent 74c7bae commit b6de854
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ private T execute0(final StatementExecuteUnit statementExecuteUnit, final boolea
try {
sqlExecutionHook.start(statementExecuteUnit.getRouteUnit(), dataSourceMetaData, isTrunkThread);
T result = executeSQL(statementExecuteUnit);
sqlExecutionHook.finishSuccess();
for (List<Object> each : parameterSets) {
sqlExecutionHook.finishSuccess();
// TODO remove after BED removed
SQLExecutionEvent finishEvent = SQLExecutionEventFactory.createEvent(sqlType, statementExecuteUnit, each, dataSourceMetaData);
finishEvent.setExecuteSuccess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,16 @@ private List<String> toStringList(final List<List<Object>> parameterSets) {

@Override
public void finishSuccess() {
if (null != span) {
span.finish();
}
span.finish();
if (null != activeSpan) {
activeSpan.deactivate();
}
}

@Override
public void finishFailure(final Exception cause) {
if (null != span) {
ShardingErrorSpan.setError(span, cause);
span.finish();
}
ShardingErrorSpan.setError(span, cause);
span.finish();
if (null != activeSpan) {
activeSpan.deactivate();
}
Expand Down

0 comments on commit b6de854

Please sign in to comment.