Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot Resolver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
142
Issues
142
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knot projects
Knot Resolver
Commits
94aebdf2
Commit
94aebdf2
authored
Jun 10, 2015
by
Marek Vavruša
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua/sandbox: default cache backend/size
parent
578d59c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
daemon/lua/sandbox.lua
daemon/lua/sandbox.lua
+8
-2
No files found.
daemon/lua/sandbox.lua
View file @
94aebdf2
...
...
@@ -52,8 +52,14 @@ setmetatable(modules, {
-- `cache.{size|storage} = value`
setmetatable
(
cache
,
{
__newindex
=
function
(
t
,
k
,
v
)
if
k
==
'size'
then
t
.
open
(
v
,
rawget
(
t
,
'current_storage'
))
elseif
k
==
'storage'
then
t
.
open
(
rawget
(
t
,
'current_size'
),
v
)
-- Defaults
local
storage
=
rawget
(
t
,
'current_storage'
)
if
not
storage
then
storage
=
'lmdb://'
end
local
size
=
rawget
(
t
,
'current_size'
)
if
not
size
then
size
=
10
*
MB
end
-- Declarative interface for cache
if
k
==
'size'
then
t
.
open
(
v
,
storage
)
elseif
k
==
'storage'
then
t
.
open
(
size
,
v
)
else
rawset
(
t
,
k
,
v
)
end
end
})
...
...
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