Skip to content

Commit ce087c5

Browse files
authored
Remove settting dependency on modules/session (#7237)
* remove settting dependency on modules/session * fix fmt * fix tests * fix lint
1 parent 2771619 commit ce087c5

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

Diff for: modules/setting/cache.go

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import (
99
"time"
1010

1111
"code.gitea.io/gitea/modules/log"
12+
13+
_ "github.com/go-macaron/cache/memcache" // memcache plugin for cache
14+
_ "github.com/go-macaron/cache/redis"
1215
)
1316

1417
// Cache represents cache settings

Diff for: modules/setting/session.go

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import (
1111
"strings"
1212

1313
"code.gitea.io/gitea/modules/log"
14-
// This ensures that VirtualSessionProvider is available
15-
_ "code.gitea.io/gitea/modules/session"
1614

1715
"github.com/go-macaron/session"
1816
)

Diff for: modules/setting/setting.go

-8
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ import (
2929

3030
"github.com/Unknwon/cae/zip"
3131
"github.com/Unknwon/com"
32-
_ "github.com/go-macaron/cache/memcache" // memcache plugin for cache
33-
_ "github.com/go-macaron/cache/redis"
34-
_ "github.com/go-macaron/session/couchbase" // couchbase plugin for session store
35-
_ "github.com/go-macaron/session/memcache" // memcache plugin for session store
36-
_ "github.com/go-macaron/session/mysql" // mysql plugin for session store
37-
_ "github.com/go-macaron/session/nodb" // nodb plugin for session store
38-
_ "github.com/go-macaron/session/postgres" // postgres plugin for session store
39-
_ "github.com/go-macaron/session/redis" // redis plugin for store session
4032
shellquote "github.com/kballard/go-shellquote"
4133
version "github.com/mcuadros/go-version"
4234
ini "gopkg.in/ini.v1"

Diff for: routers/routes/routes.go

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ import (
3535
"code.gitea.io/gitea/routers/user"
3636
userSetting "code.gitea.io/gitea/routers/user/setting"
3737

38+
// to registers all internal adapters
39+
_ "code.gitea.io/gitea/modules/session"
40+
3841
"github.com/go-macaron/binding"
3942
"github.com/go-macaron/cache"
4043
"github.com/go-macaron/captcha"

0 commit comments

Comments
 (0)