MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / streamTrimByID

Function streamTrimByID

src/t_stream.cpp:879–886  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

877
878/* Trims a stream by minimum ID. Returns the number of deleted items. */
879int64_t streamTrimByID(stream *s, streamID minid, int approx) {
880 streamAddTrimArgs args = {{0}};
881 args.trim_strategy = TRIM_STRATEGY_MINID;
882 args.approx_trim = approx;
883 args.limit = approx ? 100 * g_pserver->stream_node_max_entries : 0;
884 args.minid = minid;
885 return streamTrim(s, &args);
886}
887
888/* Parse the arguments of XADD/XTRIM.
889 *

Callers 1

RM_StreamTrimByIDFunction · 0.85

Calls 1

streamTrimFunction · 0.85

Tested by

no test coverage detected