498b235461
Build and test / Build and test AMD64 Ubuntu 22.04 (push) Failing after 0s
Publish Builder / amazonlinux2023 (push) Failing after 1s
Build and test / UT for Go (push) Has been skipped
Publish KRTE Images / KRTE (push) Failing after 1s
Build and test / Integration Test (push) Has been skipped
Build and test / Upload Code Coverage (push) Has been skipped
Publish Builder / rockylinux9 (push) Failing after 1s
Publish Builder / ubuntu22.04 (push) Failing after 0s
Publish Builder / ubuntu24.04 (push) Failing after 0s
Publish Gpu Builder / publish-gpu-builder (push) Failing after 1s
Publish Test Images / PyTest (push) Failing after 0s
Build and test / UT for Cpp (push) Has been cancelled
29 lines
895 B
Go
29 lines
895 B
Go
package streamingutil
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
const MilvusStreamingServiceEnabled = "MILVUS_STREAMING_SERVICE_ENABLED"
|
|
|
|
// IsStreamingServiceEnabled returns whether the streaming service is enabled.
|
|
func IsStreamingServiceEnabled() bool {
|
|
// TODO: check if the environment variable MILVUS_STREAMING_SERVICE_ENABLED is set
|
|
return os.Getenv(MilvusStreamingServiceEnabled) == "1"
|
|
}
|
|
|
|
// SetStreamingServiceEnabled set the env that indicates whether the streaming service is enabled.
|
|
func SetStreamingServiceEnabled() {
|
|
err := os.Setenv(MilvusStreamingServiceEnabled, "1")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// MustEnableStreamingService panics if the streaming service is not enabled.
|
|
func MustEnableStreamingService() {
|
|
if !IsStreamingServiceEnabled() {
|
|
panic("start a streaming node without enabling streaming service, please set environment variable MILVUS_STREAMING_SERVICE_ENABLED = 1")
|
|
}
|
|
}
|