Skip to content

Commit a4dd01b

Browse files
authored
Merge pull request #920 from gobitfly/BEDS-448/split-up-requires
split network and user db requires up
2 parents ae252ae + dd48a16 commit a4dd01b

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

backend/cmd/misc/commands/app_bundle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (s *AppBundleCommand) ParseCommandOptions() {
3636

3737
func (s *AppBundleCommand) Requires() misctypes.Requires {
3838
return misctypes.Requires{
39-
DBs: true,
39+
UserDBs: true,
4040
}
4141
}
4242

backend/cmd/misc/main.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,12 @@ func Run() {
135135
requires, ok := REQUIRES_LIST[opts.Command]
136136
if !ok {
137137
requires = misctypes.Requires{
138-
Bigtable: true,
139-
Redis: true,
140-
ClNode: true,
141-
ElNode: true,
142-
DBs: true,
138+
Bigtable: true,
139+
Redis: true,
140+
ClNode: true,
141+
ElNode: true,
142+
UserDBs: true,
143+
NetworkDBs: true,
143144
}
144145
}
145146

@@ -175,7 +176,7 @@ func Run() {
175176
}
176177
}
177178

178-
if requires.DBs {
179+
if requires.NetworkDBs {
179180
db.WriterDb, db.ReaderDb = db.MustInitDB(&types.DatabaseConfig{
180181
Username: cfg.WriterDatabase.Username,
181182
Password: cfg.WriterDatabase.Password,
@@ -197,6 +198,8 @@ func Run() {
197198
}, "pgx", "postgres")
198199
defer db.ReaderDb.Close()
199200
defer db.WriterDb.Close()
201+
}
202+
if requires.UserDBs {
200203
db.FrontendWriterDB, db.FrontendReaderDB = db.MustInitDB(&types.DatabaseConfig{
201204
Username: cfg.Frontend.WriterDatabase.Username,
202205
Password: cfg.Frontend.WriterDatabase.Password,
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package misctypes
22

33
type Requires struct {
4-
Bigtable bool
5-
Redis bool
6-
ClNode bool
7-
ElNode bool
8-
DBs bool
4+
Bigtable bool
5+
Redis bool
6+
ClNode bool
7+
ElNode bool
8+
NetworkDBs bool
9+
UserDBs bool
910
}

0 commit comments

Comments
 (0)