-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update support for environment-based config flags (#1239)
* set config options from env vars * clean-ups * clean-ups, add comments * clean-ups, add comments * clean-ups, add comments * update hit proxy script * Fix test and a few more clean-ups * fix: fixing flashlight checksum mismatch --------- Co-authored-by: WendelHime <[email protected]>
- Loading branch information
1 parent
d3ab3c3
commit 21d6069
Showing
6 changed files
with
104 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package app | ||
|
||
import ( | ||
"net/http" | ||
"os" | ||
) | ||
|
||
// createDirIfNotExists checks that a directory exists, creating it if necessary | ||
func createDirIfNotExists(dir string, perm os.FileMode) error { | ||
if _, err := os.Stat(dir); err != nil { | ||
if os.IsNotExist(err) { | ||
return os.MkdirAll(dir, perm) | ||
} | ||
return err | ||
} | ||
return nil | ||
} | ||
|
||
// startPprof starts a pprof server at the given address | ||
func startPprof(addr string) { | ||
log.Debugf("Starting pprof server at %s (http://%s/debug/pprof)", addr) | ||
srv := &http.Server{Addr: addr} | ||
if err := srv.ListenAndServe(); err != nil { | ||
log.Errorf("Error starting pprof server: %v", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters