summaryrefslogtreecommitdiff
path: root/app/utilities.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/utilities.go')
-rw-r--r--app/utilities.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/utilities.go b/app/utilities.go
index 75967b1..5c665e2 100644
--- a/app/utilities.go
+++ b/app/utilities.go
@@ -3,14 +3,15 @@ package main
import (
"crypto/md5"
"fmt"
- // "github.com/garyburd/redigo/redis"
+ "github.com/garyburd/redigo/redis"
"golang.org/x/crypto/bcrypt"
"io"
"io/ioutil"
"log"
"math/rand"
"net/http"
- // "time"
+ "os"
+ "time"
)
// Returns headers as map and the content of a webpage as string
@@ -49,17 +50,17 @@ func RandomKey() string {
return string(key)
}
-//var pool = newPool()
+var pool = newPool()
-/*
// Creates a pool with connections to Redis
func newPool() *redis.Pool {
return &redis.Pool{
MaxIdle: 3,
IdleTimeout: 240 * time.Second,
Dial: func() (redis.Conn, error) {
- //c, err := redis.Dial("tcp", ":6379")
- c, err := redis.Dial("tcp", revel.Config.StringDefault("redis.server", "127.0.0.1")+":"+revel.Config.StringDefault("redis.port", "6379"))
+ redis_server := os.Getenv("STATUS_REDIS_SERVER")
+ redis_port := os.Getenv("STATUS_REDIS_PORT")
+ c, err := redis.Dial("tcp", redis_server+":"+redis_port)
if err != nil {
return nil, err
}
@@ -71,7 +72,6 @@ func newPool() *redis.Pool {
},
}
}
-*/
// Hashs password with bcrypt and returns the string
func HashPassword(password string) (string, error) {