-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to use db.Transaction() (#16)
* Update Repository method의 파라미터에 db를 주입하도록 * Update gormfx 실행 시 ping check하도록 * Update db.Transaction() 사용하도록 반영
- Loading branch information
Showing
12 changed files
with
233 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
package gormfx | ||
|
||
type Config struct { | ||
DBDriver string `envconfig:"DB_DRIVER" default:""` | ||
DBUser string `envconfig:"DB_USER" default:""` | ||
DBPassword string `envconfig:"DB_PASSWORD" default:""` | ||
DBHost string `envconfig:"DB_HOST" default:""` | ||
DBName string `envconfig:"DB_NAME" default:""` | ||
DBPort string `envconfig:"DB_PORT" default:""` | ||
DBDriver string `envconfig:"DB_DRIVER" default:""` | ||
DBUser string `envconfig:"DB_USER" default:""` | ||
DBPassword string `envconfig:"DB_PASSWORD" default:""` | ||
DBHost string `envconfig:"DB_HOST" default:""` | ||
DBName string `envconfig:"DB_NAME" default:""` | ||
DBPort string `envconfig:"DB_PORT" default:""` | ||
ConnMaxLifetimeSeconds int64 `envconfig:"DB_CONN_MAX_LIFETIME_SECONDS" default:"0"` | ||
MaxIdleConns int `envconfig:"DB_MAX_IDLE_CONNS" default:"0"` | ||
MaxOpenConns int `envconfig:"DB_MAX_OPEN_CONNS" default:"0"` | ||
} | ||
|
||
func parseConfig() *Config { | ||
return &Config{ | ||
DBDriver: "mysql", | ||
DBUser: "root", | ||
DBPassword: "password", | ||
DBHost: "localhost", | ||
DBName: "dittodining", | ||
DBPort: "3306", | ||
DBDriver: "mysql", | ||
DBUser: "root", | ||
DBPassword: "password", | ||
DBHost: "localhost", | ||
DBName: "dittodining", | ||
DBPort: "3306", | ||
ConnMaxLifetimeSeconds: 1800, | ||
MaxIdleConns: 10, // TODO: DB 스펙에 따라 적절치로 조정 | ||
MaxOpenConns: 10, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 9 additions & 8 deletions
17
server/repository/recommendation/selected_restaurant_recommendation_repository.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.