nativelink
nativelink copied to clipboard
Add timestamp to BEP redis key behind feature flag
Add some kind of simple timestamp value after the sequence number, this will help with sorting in some client setups for this server that need to do sorting without having to track build_ids and sequences.
store
.update_oneshot(
StoreKey::Str(Cow::Owned(format!(
"BuildToolEventStream-{}-{}-{}",
&stream_id.build_id, &stream_id.invocation_id, sequence_number,
))),
buf.freeze(),
)
.await
.err_tip(|| "Failed to store PublishBuildToolEventStreamRequest")?;
The config would need to have an additional option under the config that enables this to be optionally added to the key. This would be under "experimental_pub_sub_channel" labeled something like "experimental_pub_sub_timestamp".
"BEP_STORE": {
"redis_store": {
"addresses": [
"${BEP_REDIS_STORE_URL:-redis://redis-headless:6379/2}"
],
"experimental_pub_sub_channel": "{{ .observed.composite.resource.spec.namespace.bep.channel }}"
}