*: add themis retry error check

remove go-themis circular dependency
This commit is contained in:
dongxu
2015-12-01 17:46:06 +08:00
parent b7dce28581
commit eb3d6478f9

View File

@ -21,6 +21,7 @@ import (
"github.com/juju/errors"
"github.com/ngaut/log"
"github.com/pingcap/go-themis"
"github.com/pingcap/tidb/terror"
)
@ -33,6 +34,7 @@ func IsRetryableError(err error) bool {
if terror.ErrorEqual(err, ErrRetryable) ||
terror.ErrorEqual(err, ErrLockConflict) ||
terror.ErrorEqual(err, ErrConditionNotMatch) ||
terror.ErrorEqual(err, themis.ErrRetryable) ||
// HBase exception message will tell you if you should retry or not
strings.Contains(err.Error(), "try again later") {
return true