Get chunk size from env
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
80b18c450d
commit
e18bd07582
11
main.go
11
main.go
@ -9,11 +9,13 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var chunkSize uint = 2
|
var chunkSize = 2
|
||||||
var currentChunk string
|
var currentChunk string
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -120,9 +122,14 @@ func ServeScores(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
if v, exists := os.LookupEnv("CHUNKSIZE"); exists {
|
||||||
|
if cs, err := strconv.Atoi(v); err == nil {
|
||||||
|
chunkSize = cs
|
||||||
|
}
|
||||||
|
}
|
||||||
var bind = flag.String("bind", "0.0.0.0:8081", "Bind port/socket")
|
var bind = flag.String("bind", "0.0.0.0:8081", "Bind port/socket")
|
||||||
var dsn = flag.String("dsn", DSNGenerator(), "DSN to connect to the MySQL server")
|
var dsn = flag.String("dsn", DSNGenerator(), "DSN to connect to the MySQL server")
|
||||||
flag.UintVar(&chunkSize, "chunkSize", chunkSize, "Taille du chunk à trouver")
|
flag.IntVar(&chunkSize, "chunkSize", chunkSize, "Taille du chunk à trouver")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
newChunk()
|
newChunk()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user