Commit e0fe8708 authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed in namimg poa_name/PoaNae fi in traffic_patterns

parent b9803f9c
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -589,7 +589,7 @@ func (tm *TrafficMgr) CreatePoaLoad(poaName string, category string) (err error)

	// Create Traffic Load entry
	query := `INSERT INTO ` + TrafficTable +
		` (poaName, category, "0000-0300", "0300-0600", "0600-0900", "0900-1200", "1200-1500", "1500-1800", "1800-2100", "2100-2400")
		` (poa_name, category, "0000-0300", "0300-0600", "0600-0900", "0900-1200", "1200-1500", "1500-1800", "1800-2100", "2100-2400")
			VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)`
	_, err = tm.db.Exec(query, poaName, category, loadTime[0], loadTime[1], loadTime[2], loadTime[3], loadTime[4], loadTime[5], loadTime[6], loadTime[7])
	if err != nil {
@@ -597,9 +597,6 @@ func (tm *TrafficMgr) CreatePoaLoad(poaName string, category string) (err error)
		return err
	}

	// Notify listener
	// tm.notifyListener(TypePoa, name)

	if profiling {
		now := time.Now()
		log.Debug("CreatePoaLoad: ", now.Sub(profilingTimers["CreatePoaLoad"]))
@@ -622,9 +619,9 @@ func (tm *TrafficMgr) GetPoaLoad(poaName string) (poaLoads *PoaLoads, err error)
	// Get Poa entry
	var rows *sql.Rows
	rows, err = tm.db.Query(`
		SELECT poaName, category, "0000-0300", "0300-0600", "0600-0900", "0900-1200", "1200-1500", "1500-1800", "1800-2100", "2100-2400"
		SELECT poa_name, category, "0000-0300", "0300-0600", "0600-0900", "0900-1200", "1200-1500", "1500-1800", "1800-2100", "2100-2400"
		FROM `+TrafficTable+`
		WHERE poaName = ($1)`, poaName)
		WHERE poa_name = ($1)`, poaName)
	if err != nil {
		log.Error(err.Error())
		return nil, err
@@ -681,7 +678,7 @@ func (tm *TrafficMgr) GetAllPoaLoad() (poaLoadMap map[string]*PoaLoads, err erro
	// Get POA entries
	var rows *sql.Rows
	rows, err = tm.db.Query(`
		SELECT poaName, category, "0000-0300", "0300-0600", "0600-0900", "0900-1200", "1200-1500", "1500-1800", "1800-2100", "2100-2400"
		SELECT poa_name, category, "0000-0300", "0300-0600", "0600-0900", "0900-1200", "1200-1500", "1500-1800", "1800-2100", "2100-2400"
		FROM ` + TrafficTable)
	if err != nil {
		log.Error(err.Error())