There are few database functions related to global settings which are required to be executed when trasa server starts. Implement "insert if not exist" code to only fire database function if data does not exist already.
Log sample
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:239 github.com/seknox/trasa/server/initdb.storeGlobalDynamicServiceSetting pq: duplicate key value violates unique constraint "unique_globalsettings"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:125 github.com/seknox/trasa/server/initdb.storeGlobalPasswordPolicy Global Password Policy stored
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:320 github.com/seknox/trasa/server/initdb.storeDefaultSecRules pq: duplicate key value violates unique constraint "unique_secrule"
TRAC[2020-11-11T21:00:55+05:45]initdb/init.go:139 github.com/seknox/trasa/server/initdb.storeDeviceHygieneCheck pq: duplicate key value violates unique constraint "unique_globalsettings"
There are few database functions related to global settings which are required to be executed when trasa server starts. Implement "insert if not exist" code to only fire database function if data does not exist already.
Log sample