Skip to content

Remove superfluous try catch blocks from Lettuce*Commands [DATAREDIS-1224] #1797

Closed
@spring-projects-issues

Description

@spring-projects-issues

Christoph Strobl opened DATAREDIS-1224 and commented

The LettuceCommands have repetitive code fragments within try - catch blocks for differentiating between transaction, pipeline and normal command execution.
This can be simplified by using a RedisFuture

return connection.invoke(connection.getAsyncConnection().geodist(key, member1, member2, geoUnit), distanceConverter);

// ...

<S, T> T invoke(RedisFuture<S> future, Converter<S, T> converter) {
	if (isPipelined()) {
		pipeline(newLettuceResult(future, converter));
		return null;
	}
	if (isQueueing()) {
		transaction(newLettuceResult(future, converter));
		return null;
	}
	return NullableResult.of((S) await(future)).convert(converter).get();
}

No further details from DATAREDIS-1224

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions