This commit is contained in:
Jeffrey Paul 2024-06-01 16:07:34 -07:00
parent 635f2650e9
commit df4dbfdb1b
3 changed files with 7 additions and 8 deletions

View File

@ -19,21 +19,21 @@ lint:
golangci-lint run
sh -c 'test -z "$$(gofmt -l .)"'
debug: ./$(FN)d
debug: ./$(FN)
DEBUG=1 GOTRACEBACK=all ./$(FN)d
debugger:
cd cmd/$(FN)d && dlv debug main.go
cd cmd/$(FN) && dlv debug main.go
run: ./$(FN)d
./$(FN)d
clean:
-rm -f ./$(FN)d debug.log
-rm -f ./$(FN) debug.log
docker:
docker build --progress plain .
./$(FN)d: cmd/$(FN)d/main.go internal/*/*.go assets/*/*
cd ./cmd/$(FN)d && \
go build -o ../../$(FN)d $(GOFLAGS) .
./$(FN): cmd/$(FN)/main.go internal/*/*.go assets/*/*
cd ./cmd/$(FN) && \
go build -o ../../$(FN) $(GOFLAGS) .

View File

@ -78,7 +78,7 @@ func (d *Database) Get() (*gorm.DB, error) {
}
func (d *Database) Connect() error {
dsn := d.params.Config.DatabaseDSN
dsn := d.params.Config.DBDSN
if dsn == "" {
err := errors.New("database DSN is empty")
d.log.Error().Err(err).Msg("failed to get database DSN from config")
@ -123,4 +123,3 @@ func (d *Database) Ping() error {
d.log.Info().Msg("successfully pinged the database")
return nil
}