File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 "os"
55 "strconv"
66 "time"
7+
8+ "github.com/glimesh/broadcast-box/internal/environment"
79)
810
911const (
@@ -53,21 +55,21 @@ type Manager struct {
5355
5456func NewManager () * Manager {
5557 maxHistory := DefaultMaxHistory
56- if val := os .Getenv ("CHAT_MAX_HISTORY" ); val != "" {
58+ if val := os .Getenv (environment . ChatMaxHistory ); val != "" {
5759 if i , err := strconv .Atoi (val ); err == nil {
5860 maxHistory = i
5961 }
6062 }
6163
6264 defaultTTL := DefaultTTL
63- if val := os .Getenv ("CHAT_DEFAULT_TTL" ); val != "" {
65+ if val := os .Getenv (environment . ChatDefaultTTL ); val != "" {
6466 if d , err := time .ParseDuration (val ); err == nil {
6567 defaultTTL = d
6668 }
6769 }
6870
6971 cleanupInterval := DefaultCleanupInterval
70- if val := os .Getenv ("CHAT_CLEANUP_INTERVAL" ); val != "" {
72+ if val := os .Getenv (environment . ChatCleanupInterval ); val != "" {
7173 if d , err := time .ParseDuration (val ); err == nil && d > 0 {
7274 cleanupInterval = d
7375 }
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ const (
1212 EnableProfiling = "ENABLE_PROFILING"
1313
1414 // SSL
15- useSSL = "USE_SSL"
1615 SSLKey = "SSL_KEY"
1716 SSLCert = "SSL_CERT"
1817
@@ -26,6 +25,11 @@ const (
2625 frontendPath = "FRONTEND_PATH"
2726 FrontendAdminToken = "FRONTEND_ADMIN_TOKEN"
2827
28+ // CHAT
29+ ChatMaxHistory = "CHAT_MAX_HISTORY"
30+ ChatDefaultTTL = "CHAT_DEFAULT_TTL"
31+ ChatCleanupInterval = "CHAT_CLEANUP_INTERVAL"
32+
2933 // WEBRTC
3034 IncludeLoopbackCandidate = "INCLUDE_LOOPBACK_CANDIDATE"
3135 NetworkTypes = "NETWORK_TYPES"
You can’t perform that action at this time.
0 commit comments