fixed bad rebase merge
Original commit: elastic/x-pack-elasticsearch@a6793fedf8
This commit is contained in:
parent
575208c338
commit
33bc0761e7
|
@ -9,7 +9,6 @@ import org.elasticsearch.common.Nullable;
|
|||
import org.elasticsearch.common.joda.time.PeriodType;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.watcher.actions.ActionStatus;
|
||||
import org.elasticsearch.watcher.actions.throttler.Throttler;
|
||||
import org.elasticsearch.watcher.execution.WatchExecutionContext;
|
||||
import org.elasticsearch.watcher.support.clock.Clock;
|
||||
|
||||
|
|
|
@ -287,19 +287,10 @@ public class Watch implements TriggerEngine.Job, ToXContent {
|
|||
} else if (Field.TRANSFORM.match(currentFieldName)) {
|
||||
transform = transformRegistry.parse(id, parser);
|
||||
} else if (Field.THROTTLE_PERIOD.match(currentFieldName)) {
|
||||
<<<<<<< HEAD
|
||||
if (token == XContentParser.Token.VALUE_STRING) {
|
||||
throttlePeriod = TimeValue.parseTimeValue(parser.text(), null);
|
||||
} else if (token == XContentParser.Token.VALUE_NUMBER) {
|
||||
throttlePeriod = TimeValue.timeValueMillis(parser.longValue());
|
||||
} else {
|
||||
throw new ParseException("could not parse watch [{}]. expected field [{}] to either be string or numeric, but found [{}] instead", id, currentFieldName, token);
|
||||
=======
|
||||
try {
|
||||
throttlePeriod = WatcherDateTimeUtils.parseTimeValue(parser, null);
|
||||
} catch (WatcherDateTimeUtils.ParseException pe) {
|
||||
throw new ParseException("could not parse watch [{}]. failed to parse time value for field [{}]", pe, id, currentFieldName);
|
||||
>>>>>>> Centralized xcontent parsing of time values
|
||||
}
|
||||
} else if (Field.ACTIONS.match(currentFieldName)) {
|
||||
actions = actionRegistry.parseActions(id, parser);
|
||||
|
|
Loading…
Reference in New Issue