Developing lightweight computation at the DSG edge

Commit 4a253c88 authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[monitor-assign] Relocate db_host and db_port flags

Fixes issue #4

.
Signed-off-by: default avatarRoger Pueyo Centelles <roger.pueyo@guifi.net>
parent c635dda6
......@@ -108,14 +108,6 @@ func main() {
// The initialize() function manages the execution parameters, sets timers, etc.
func initialize() {
dbHostPtr := flag.String("db_host", dbHost, dbHostHelp )
dbPortPtr := flag.Int("db_port", dbPort, dbPortHelp )
flag.Parse()
dbHost = *dbHostPtr
dbPort = *dbPortPtr
fmt.Println("Initializing...")
// Manage command line flags and execution settings
......@@ -150,6 +142,8 @@ func initializeTimers() {
func initializeFlags() {
//Define and parse command line flags
dbHostPtr := flag.String("db_host", dbHost, dbHostHelp)
dbPortPtr := flag.Int("db_port", dbPort, dbPortHelp)
idInt, _ := strconv.ParseInt(ID, 10, 32)
idPtr := flag.Int("id", int(idInt), idHelp)
maxDevsPtr := flag.Int("maxDevs", maxDevs, maxDevsHelp)
......@@ -172,6 +166,9 @@ func initializeFlags() {
IDts = fmt.Sprintf("%s_ts", ID)
}
dbHost = *dbHostPtr
dbPort = *dbPortPtr
//Maximum devices to monitor
if *maxDevsPtr > 0 {
maxDevs = *maxDevsPtr
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment