Skip to content

Commit

Permalink
Use DATABASE_URL as a fallback to --database-url.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnando committed Sep 22, 2018
1 parent 466d618 commit abf5e6c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: lumenaddr --database-url "$DATABASE_URL" --encryption-key "$ENCRYPTION_KEY" $SUFFIXES
worker: lumenaddr --encryption-key "$ENCRYPTION_KEY" $SUFFIXES
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func main() {
words = strings.Split(words[0], " ")
}

if databaseUrl == "" {
databaseUrl = os.Getenv("DATABASE_URL")
}

throttle = make(chan bool, maxConcurrency)
saveToDatabase = databaseUrl != "" && encryptionKey != ""

Expand Down

0 comments on commit abf5e6c

Please sign in to comment.