File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -16,18 +16,20 @@ var ENV = &structure.ENV{
1616func Load () {
1717 ENV .LOG_LEVEL = os .Getenv ("LOG_LEVEL" )
1818
19- discoveryInterval , err := strconv . Atoi ( os .Getenv ("DISCOVERY_INTERVAL" ) )
19+ discoveryIntervalStr := os .Getenv ("DISCOVERY_INTERVAL" )
2020
21- if err != nil {
22- if discoveryInterval > 0 {
21+ if discoveryIntervalStr != "" {
22+ discoveryInterval , err := strconv .Itoa (discoveryIntervalStr )
23+ if err != nil {
2324 ENV .DISCOVERY_INTERVAL = discoveryInterval
2425 }
2526 }
2627
27- aliveInterval , err := strconv . Atoi ( os .Getenv ("ALIVE_INTERVAL" ) )
28+ aliveIntervalStr := os .Getenv ("ALIVE_INTERVAL" )
2829
29- if err != nil {
30- if aliveInterval > 0 {
30+ if aliveIntervalStr != "" {
31+ aliveInterval , err := strconv .Itoa (aliveIntervalStr )
32+ if err != nil {
3133 ENV .ALIVE_INTERVAL = aliveInterval
3234 }
3335 }
@@ -39,4 +41,4 @@ func Load() {
3941
4042func Log () {
4143 logger .Dev ("Loaded Environment:" , ENV )
42- }
44+ }
You can’t perform that action at this time.
0 commit comments