@@ -8,6 +8,7 @@ local log = require('log')
8
8
9
9
local fmt = string.format
10
10
11
+ -- luacheck: ignore package
11
12
local internal_so_path = package .search (' memcached.internal' )
12
13
assert (internal_so_path , " Failed to find memcached/internal.so library" )
13
14
local memcached_internal = ffi .load (internal_so_path )
@@ -89,15 +90,15 @@ void memcached_handler (struct memcached_service *p, int fd);
89
90
int memcached_setsockopt (int fd , const char * family , const char * type );
90
91
]]
91
92
92
- function startswith (str , start )
93
+ local function startswith (str , start )
93
94
return string.sub (str , 1 , string.len (start )) == start
94
95
end
95
96
96
97
local typetable = {
97
98
name = {
98
99
' string' ,
99
100
function () return ' memcached' end ,
100
- function (x ) return true end ,
101
+ function () return true end ,
101
102
[[ Name of memcached instance]]
102
103
},
103
104
uri = {
@@ -115,7 +116,7 @@ local typetable = {
115
116
expire_enabled = {
116
117
' boolean' ,
117
118
function () return true end ,
118
- function (x ) return true end ,
119
+ function () return true end ,
119
120
[[ configure availability of expiration daemon]]
120
121
},
121
122
expire_items_per_iter = {
@@ -217,6 +218,7 @@ local function config_initial(cfg)
217
218
box .error { reason = err }
218
219
end
219
220
221
+ -- luacheck: no unused
220
222
local function config_help ()
221
223
for k , v in pairs (typetable ) do
222
224
log .info (' %s: %s' , k , v [4 ])
@@ -310,14 +312,14 @@ local memcached_methods = {
310
312
if (self .listener ~= nil ) then
311
313
self .listener :close ()
312
314
end
313
- local rc = memcached_internal .memcached_stop (self .service )
315
+ memcached_internal .memcached_stop (self .service )
314
316
self .status = STOPPED
315
317
return self
316
318
end ,
317
319
info = function (self )
318
320
local stats = memcached_internal .memcached_get_stat (self .service )
319
321
local retval = {}
320
- for k , v in pairs (stat_table ) do
322
+ for _ , v in pairs (stat_table ) do
321
323
retval [v ] = stats [0 ][v ]
322
324
end
323
325
return retval
0 commit comments