Update in preparation for Heroku

This commit is contained in:
2014-09-04 23:50:46 +01:00
parent 897f5e5d30
commit 1e064ff0d7
3 changed files with 8 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
kotaku-uk-rss

1
Procfile Normal file
View File

@@ -0,0 +1 @@
web: ./kotaku-uk-rss

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"log"
"net/http"
"os"
"sort"
"sync"
"time"
@@ -175,7 +176,7 @@ func updateRssLoop() {
feed, _ := buildFeed(articles).ToRss()
rssCache.Set(feed)
fmt.Println("done")
fmt.Println("taking a 60 second nap ^_^")
fmt.Println("taking a nap for 60 seconds ^_^")
time.Sleep(60 * time.Second)
}
}
@@ -201,5 +202,8 @@ var rssCache = RssCache{}
func main() {
go updateRssLoop()
http.HandleFunc("/rss", serveRss)
http.ListenAndServe(":1234", nil)
err := http.ListenAndServe(":"+os.Getenv("PORT"), nil)
if err != nil {
panic(err)
}
}