Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
1d356539
Commit
1d356539
authored
May 11, 2023
by
Felipe Andrade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert cache.go
parent
f8013936
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
33 deletions
+0
-33
cache.go
proxyd/cache.go
+0
-33
No files found.
proxyd/cache.go
View file @
1d356539
...
@@ -12,7 +12,6 @@ import (
...
@@ -12,7 +12,6 @@ import (
type
Cache
interface
{
type
Cache
interface
{
Get
(
ctx
context
.
Context
,
key
string
)
(
string
,
error
)
Get
(
ctx
context
.
Context
,
key
string
)
(
string
,
error
)
Put
(
ctx
context
.
Context
,
key
string
,
value
string
)
error
Put
(
ctx
context
.
Context
,
key
string
,
value
string
)
error
Clear
(
ctx
context
.
Context
)
error
}
}
const
(
const
(
...
@@ -43,11 +42,6 @@ func (c *cache) Put(ctx context.Context, key string, value string) error {
...
@@ -43,11 +42,6 @@ func (c *cache) Put(ctx context.Context, key string, value string) error {
return
nil
return
nil
}
}
func
(
c
*
cache
)
Clear
(
ctx
context
.
Context
)
error
{
c
.
lru
.
Purge
()
return
nil
}
type
redisCache
struct
{
type
redisCache
struct
{
rdb
*
redis
.
Client
rdb
*
redis
.
Client
}
}
...
@@ -81,29 +75,6 @@ func (c *redisCache) Put(ctx context.Context, key string, value string) error {
...
@@ -81,29 +75,6 @@ func (c *redisCache) Put(ctx context.Context, key string, value string) error {
return
err
return
err
}
}
func
(
c
*
redisCache
)
Clear
(
ctx
context
.
Context
)
error
{
patterns
:=
[]
string
{
"lvc:*"
,
"method:*"
}
for
_
,
p
:=
range
patterns
{
scmd
:=
c
.
rdb
.
Keys
(
ctx
,
p
)
err
:=
scmd
.
Err
()
if
err
!=
nil
{
RecordRedisError
(
"CacheClear"
)
return
err
}
keys
,
_
:=
scmd
.
Result
()
icmd
:=
c
.
rdb
.
Del
(
ctx
,
keys
...
)
err
=
icmd
.
Err
()
if
err
!=
nil
{
RecordRedisError
(
"CacheClear"
)
return
err
}
}
return
nil
}
type
cacheWithCompression
struct
{
type
cacheWithCompression
struct
{
cache
Cache
cache
Cache
}
}
...
@@ -132,10 +103,6 @@ func (c *cacheWithCompression) Put(ctx context.Context, key string, value string
...
@@ -132,10 +103,6 @@ func (c *cacheWithCompression) Put(ctx context.Context, key string, value string
return
c
.
cache
.
Put
(
ctx
,
key
,
string
(
encodedVal
))
return
c
.
cache
.
Put
(
ctx
,
key
,
string
(
encodedVal
))
}
}
func
(
c
*
cacheWithCompression
)
Clear
(
ctx
context
.
Context
)
error
{
return
c
.
cache
.
Clear
(
ctx
)
}
type
GetLatestBlockNumFn
func
(
ctx
context
.
Context
)
(
uint64
,
error
)
type
GetLatestBlockNumFn
func
(
ctx
context
.
Context
)
(
uint64
,
error
)
type
GetLatestGasPriceFn
func
(
ctx
context
.
Context
)
(
uint64
,
error
)
type
GetLatestGasPriceFn
func
(
ctx
context
.
Context
)
(
uint64
,
error
)
...
...
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