Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
29b60d60
authored
2014-09-03 22:43:06 +0800
by
Wang Hao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed uninitialized return error if StartAndGC fails
1 parent
6eee2233
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
cache/cache.go
cache/cache.go
View file @
29b60d6
...
...
@@ -81,13 +81,13 @@ func Register(name string, adapter Cache) {
// Create a new cache driver by adapter name and config string.
// config need to be correct JSON as string: {"interval":360}.
// it will start gc automatically.
func
NewCache
(
adapterName
,
config
string
)
(
adapter
Cache
,
e
error
)
{
func
NewCache
(
adapterName
,
config
string
)
(
adapter
Cache
,
e
rr
error
)
{
adapter
,
ok
:=
adapters
[
adapterName
]
if
!
ok
{
e
=
fmt
.
Errorf
(
"cache: unknown adapter name %q (forgot to import?)"
,
adapterName
)
e
rr
=
fmt
.
Errorf
(
"cache: unknown adapter name %q (forgot to import?)"
,
adapterName
)
return
}
err
:
=
adapter
.
StartAndGC
(
config
)
err
=
adapter
.
StartAndGC
(
config
)
if
err
!=
nil
{
adapter
=
nil
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment