mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
embed: fix compaction runtime err
Handle negative value input which currently gives a runtime error.
This commit is contained in:
@@ -812,7 +812,7 @@ func (e *Etcd) GetLogger() *zap.Logger {
|
||||
|
||||
func parseCompactionRetention(mode, retention string) (ret time.Duration, err error) {
|
||||
h, err := strconv.Atoi(retention)
|
||||
if err == nil {
|
||||
if err == nil && h >= 0 {
|
||||
switch mode {
|
||||
case CompactorModeRevision:
|
||||
ret = time.Duration(int64(h))
|
||||
|
||||
Reference in New Issue
Block a user