Skip to content

Commit 4729cf3

Browse files
author
Jeroen Bobbeldijk
committed
Merge remote-tracking branch 'origin/development'
2 parents d871f74 + bfd11ed commit 4729cf3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ You can also wrap it in a upstart/init.d script, examples on that will come soon
2828
| --handle-queues | "" | Comma separated list of queues to handle, can't be used together with skip-queues. |
2929
| --queue-workers | "" | Amount of workers to use per queue, format: "publish_scheduler:1,entity_update:4". |
3030
| --default-worker-count | Amount of CPUs-1 | Default amount of workers, default value is amount of CPUs - 1. |
31+
| --db-password | DB Password | Password for the database if it can't be read by Drupal Console. |
3132

3233
## Compiling
3334
Make sure you are able to run a Go 1.6 (though 1.4/1.5 should also work) environment and that you have [Godeps](https://github.com/tools/godep) available.

directqueue.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type Config struct {
3030
Console string
3131
Site string
3232
URI string
33+
Password string
3334
HandleQueues []string
3435
SkipQueues []string
3536
QueueWorkers map[string]int
@@ -53,6 +54,7 @@ func main() {
5354
handleQueues string
5455
queueWorkers string
5556
defaultWorkerCount int
57+
password string
5658
)
5759

5860
app.Flags = []cli.Flag{
@@ -98,6 +100,12 @@ func main() {
98100
Usage: "Default amount of workers, default value is amount of CPUs - 1.",
99101
Destination: &defaultWorkerCount,
100102
},
103+
cli.StringFlag{
104+
Name: "db-password",
105+
Value: "",
106+
Usage: "Overwrite the db password.",
107+
Destination: &password,
108+
},
101109
}
102110

103111
app.Name = "DirectQueue"
@@ -108,6 +116,7 @@ func main() {
108116
Console: console,
109117
Site: site,
110118
URI: uri,
119+
Password: password,
111120
DefaultWorkerCount: defaultWorkerCount,
112121
Context: c,
113122
}
@@ -375,6 +384,10 @@ func getDBConnectString(config Config) (db_connect string, err error) {
375384
matches[5] = "3306"
376385
}
377386

387+
if config.Password != "" {
388+
matches[3] = config.Password
389+
}
390+
378391
// Put together the connection details.
379392
// matches[1] = --database
380393
// matches[2] = --user

0 commit comments

Comments
 (0)