From 0865dd4651e2ff0ffb35481f886f6d110900eac0 Mon Sep 17 00:00:00 2001 From: Azareal Date: Sun, 23 Feb 2020 19:27:35 +1000 Subject: [PATCH] bump requirements up to go 1.13 don't forget main.go --- .travis.yml | 1 - README.md | 2 +- main.go | 31 ++++++++++++++++++++++--------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index fd11fd5b..fab70540 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ env: - CC_TEST_REPORTER_ID=38ad11f95f28b1d33c9c31467f9eb5eb4e336e4e0e36046c86a4f7ff6e4c3977 language: go go: - - "1.12" - "1.13" - master before_install: diff --git a/README.md b/README.md index 50a097db..4d523171 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Other modern features like alerts, likes, advanced dashboard with live stats (CP # Requirements -Go 1.12 or newer - You will need to install this. Pick the .msi, if you want everything sorted out for you rather than having to go around updating the environment settings. https://golang.org/doc/install +Go 1.13 or newer - You will need to install this. Pick the .msi, if you want everything sorted out for you rather than having to go around updating the environment settings. https://golang.org/doc/install For Ubuntu, you can consult: https://tecadmin.net/install-go-on-ubuntu/ You will also want to run `ln -s /usr/local/go/bin/go` (replace /usr/local with where ever you put Go), so that go becomes visible to other users. diff --git a/main.go b/main.go index d7041da8..7a9d42f1 100644 --- a/main.go +++ b/main.go @@ -25,13 +25,14 @@ import ( "time" c "github.com/Azareal/Gosora/common" - _ "github.com/Azareal/Gosora/extend" co "github.com/Azareal/Gosora/common/counters" - p "github.com/Azareal/Gosora/common/phrases" meta "github.com/Azareal/Gosora/common/meta" - "github.com/Azareal/Gosora/query_gen" + p "github.com/Azareal/Gosora/common/phrases" + _ "github.com/Azareal/Gosora/extend" + qgen "github.com/Azareal/Gosora/query_gen" "github.com/Azareal/Gosora/routes" "github.com/fsnotify/fsnotify" + //"github.com/lucas-clemente/quic-go/http3" "github.com/pkg/errors" ) @@ -56,13 +57,13 @@ func afterDBInit() (err error) { log.Print("Exitted storeInit") var uids []int - tcache := c.Topics.GetCache() - if tcache != nil { + tc := c.Topics.GetCache() + if tc != nil { // Preload ten topics to get the wheels going var count = 10 - if tcache.GetCapacity() <= 10 { + if tc.GetCapacity() <= 10 { count = 2 - if tcache.GetCapacity() <= 2 { + if tc.GetCapacity() <= 2 { count = 0 } } @@ -103,8 +104,8 @@ func afterDBInit() (err error) { } } - ucache := c.Users.GetCache() - if ucache != nil { + uc := c.Users.GetCache() + if uc != nil { // Preload associated users too... for _, uid := range uids { _, _ = c.Users.Get(uid) @@ -315,6 +316,10 @@ func storeInit() (err error) { if err != nil { return errors.WithStack(err) } + co.PerfCounter, err = co.NewDefaultPerfCounter(acc) + if err != nil { + return errors.WithStack(err) + } log.Print("Initialising the meta store") c.Meta, err = meta.NewDefaultMetaStore(acc) @@ -623,6 +628,14 @@ func startServer() { // TODO: Let users run *both* HTTP and HTTPS log.Print("Initialising the HTTP server") + /*if c.Dev.QuicPort != 0 { + sQuicPort := strconv.Itoa(c.Dev.QuicPort) + log.Print("Listening on quic port " + sQuicPort) + go func() { + c.StoppedServer(http3.ListenAndServeQUIC(":"+sQuicPort, c.Config.SslFullchain, c.Config.SslPrivkey, router)) + }() + }*/ + if !c.Site.EnableSsl { if c.Site.Port == "" { c.Site.Port = "80"