MCPcopy Create free account
hub / github.com/F-Stack/f-stack / streamTrimByLength

Function streamTrimByLength

app/redis-6.2.6/src/t_stream.c:869–877  ·  view source on GitHub ↗

Trims a stream by length. Returns the number of deleted items. */

Source from the content-addressed store, hash-verified

867
868/* Trims a stream by length. Returns the number of deleted items. */
869int64_t streamTrimByLength(stream *s, long long maxlen, int approx) {
870 streamAddTrimArgs args = {
871 .trim_strategy = TRIM_STRATEGY_MAXLEN,
872 .approx_trim = approx,
873 .limit = approx ? 100 * server.stream_node_max_entries : 0,
874 .maxlen = maxlen
875 };
876 return streamTrim(s, &args);
877}
878
879/* Trims a stream by minimum ID. Returns the number of deleted items. */
880int64_t streamTrimByID(stream *s, streamID minid, int approx) {

Callers 1

RM_StreamTrimByLengthFunction · 0.85

Calls 1

streamTrimFunction · 0.85

Tested by

no test coverage detected