pull/429/head
Hunter Long 2020-03-04 07:58:42 -08:00
parent 0d82b59586
commit f677f49293
5 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
FROM golang:1.13.5-alpine FROM golang:1.14-alpine
LABEL maintainer="Hunter Long (https://github.com/hunterlong)" LABEL maintainer="Hunter Long (https://github.com/hunterlong)"
ARG VERSION ARG VERSION
RUN apk add --update --no-cache libstdc++ gcc g++ make git ca-certificates linux-headers wget curl jq libsass nodejs nodejs-npm RUN apk add --update --no-cache libstdc++ gcc g++ make git ca-certificates linux-headers wget curl jq libsass nodejs nodejs-npm

View File

@ -77,7 +77,7 @@ func processSetupHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
if _, err = configs.LoadConfigs(); err != nil { if confg, err = configs.LoadConfigFile(utils.Directory); err != nil {
log.Errorln(err) log.Errorln(err)
sendErrorJson(err, w, r) sendErrorJson(err, w, r)
return return
@ -88,7 +88,9 @@ func processSetupHandler(w http.ResponseWriter, r *http.Request) {
if err := confg.Delete(); err != nil { if err := confg.Delete(); err != nil {
log.Errorln(err) log.Errorln(err)
sendErrorJson(err, w, r) sendErrorJson(err, w, r)
return
} }
return
} }
if err = confg.MigrateDatabase(); err != nil { if err = confg.MigrateDatabase(); err != nil {

View File

@ -33,11 +33,10 @@ func All() []*Checkin {
func (c *Checkin) Create() error { func (c *Checkin) Create() error {
c.ApiKey = utils.RandomString(7) c.ApiKey = utils.RandomString(7)
db := DB().Create(&c)
c.Start() c.Start()
go c.CheckinRoutine() go c.CheckinRoutine()
db := DB().Create(&c)
return db.Error() return db.Error()
} }

View File

@ -7,7 +7,7 @@ import (
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
) )
func loadConfigFile(directory string) (*DbConfig, error) { func LoadConfigFile(directory string) (*DbConfig, error) {
var configs *DbConfig var configs *DbConfig
log.Infof("Attempting to read config file at: %s/config.yml ", directory) log.Infof("Attempting to read config file at: %s/config.yml ", directory)

View File

@ -40,12 +40,12 @@ func LoadConfigs() (*DbConfig, error) {
if dbConn != "" { if dbConn != "" {
configs, err := loadConfigEnvs() configs, err := loadConfigEnvs()
if err != nil { if err != nil {
return loadConfigFile(utils.Directory) return LoadConfigFile(utils.Directory)
} }
return configs, nil return configs, nil
} }
return loadConfigFile(utils.Directory) return LoadConfigFile(utils.Directory)
} }
func findDbFile(configs *DbConfig) string { func findDbFile(configs *DbConfig) string {