Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
3821b2cb
Commit
3821b2cb
authored
Jan 07, 2016
by
JessonChan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
createdTime typo fixed
parent
8aed4c13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
memory.go
cache/memory.go
+4
-4
No files found.
cache/memory.go
View file @
3821b2cb
...
...
@@ -27,10 +27,10 @@ var (
DefaultEvery
=
60
// 1 minute
)
// MemoryItem store
ene
ry cache item.
// MemoryItem store
memo
ry cache item.
type
MemoryItem
struct
{
val
interface
{}
cratedTime
time
.
Time
cr
e
atedTime
time
.
Time
lifespan
int64
}
...
...
@@ -39,7 +39,7 @@ func (mi *MemoryItem) isExpire() bool {
if
mi
.
lifespan
==
0
{
return
false
}
return
time
.
Now
()
.
Unix
()
-
mi
.
cratedTime
.
Unix
()
>
mi
.
lifespan
return
time
.
Now
()
.
Unix
()
-
mi
.
cr
e
atedTime
.
Unix
()
>
mi
.
lifespan
}
// MemoryCache is Memory cache adapter.
...
...
@@ -88,7 +88,7 @@ func (bc *MemoryCache) Put(name string, value interface{}, lifespan int64) error
defer
bc
.
Unlock
()
bc
.
items
[
name
]
=
&
MemoryItem
{
val
:
value
,
cratedTime
:
time
.
Now
(),
cr
e
atedTime
:
time
.
Now
(),
lifespan
:
lifespan
,
}
return
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment