aboutsummaryrefslogtreecommitdiff
path: root/cmd/server/main.go
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2021-10-24 13:10:20 -0400
committerMitchell Riedstra <mitch@riedstra.dev>2021-10-24 13:10:20 -0400
commite0d4a3e50921dc07e23ef9aa107bdc78b3adf176 (patch)
tree3b7abcbc091cafd7591e91d0ad96e3b5760f3ba5 /cmd/server/main.go
parent268fcf7e6b671d4959a12111d5abf553bf0a201b (diff)
downloadgo-website-0.0.15.tar.gz
go-website-0.0.15.tar.xz
Use hash in redis. Key can be set in conf.v0.0.15
Diffstat (limited to 'cmd/server/main.go')
-rw-r--r--cmd/server/main.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go
index d76f938..21f7031 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -34,8 +34,8 @@ func main() { //nolint:funlen
indexPath := fl.String("i", defaultIndexPath,
"Path in which, when called will rebuild the index and clear the cache")
- redisAddr := fl.String("r", "127.0.0.1:6379",
- "Redis server set to \"\" to disable")
+ redisAddr := fl.String("r", "127.0.0.1:6379", "Redis server set to \"\" to disable")
+ redisKey := fl.String("rk", "go-website", "Redis key to use for storing cached pages")
pageTimeout := fl.Int("timeout", 15, "Seconds until page timeout for read and write")
@@ -63,6 +63,10 @@ func main() { //nolint:funlen
app.ReIndexPath = *indexPath
}
+ if app.RedisKey == "" {
+ app.RedisKey = *redisKey
+ }
+
if *redisAddr != "" {
app.redisPool = &redis.Pool{
MaxIdle: 80, //nolint:gomnd