This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t/config.t ..... ok | |
t/connector.t .. 6/? | |
# Failed test 'TEST 6: password - pattern "ERR Client sent AUTH, but no password is set" should match a line in error.log (req 0)' | |
# at /usr/share/perl5/site_perl/Test/Nginx/Socket.pm line 1146. | |
WARNING: TEST 7: Bad unix domain socket path should fail - 2020/01/24 16:37:39 [crit] 48085#0: *1 connect() to unix://GARBAGE_PATH_AKFDKAJSFKJSAFLKJSADFLKJSANCKAJSNCKJSANCLKAJS failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init_by_lua_block { | |
-- This configures ledge, and can only be done during init. If you skip this, default Redis connection | |
-- details will be assumed. | |
-- | |
-- The only things configured here are the main metadata Redis connection, and the Qless Redis DB. | |
-- Any unknown config will error hard on server load | |
require("ledge").configure({ | |
redis_connector_params = { -- anything supported by lua-resty-redis-connector works here | |
url = "redis://127.0.0.1:6380/1", | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location /setcookie { | |
content_by_lua ' | |
ngx.header.set_cookie = { "login=test%2Ftest", "cookie2" } | |
ngx.say("OK") | |
'; | |
} | |
location /getcookie { | |
content_by_lua ' | |
local resty_http = require "resty.http" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Reimplemented coroutine.wrap, returning "nil, err" if the coroutine cannot | |
-- be resumed. | |
local co_wrap = function(func) | |
local co = coroutine.create(func) | |
ngx.log(ngx.DEBUG, "co created with status ", coroutine.status(co)) | |
return function(...) | |
if coroutine.status(co) == "suspended" then | |
return select(2, coroutine.resume(co, ...)) | |
else | |
return nil, "can't resume a " .. coroutine.status(co) .. " coroutine" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jhurst@ubuntu:~/.gtk/source$ $AD/2.0-ongoing/tools/build-gtk-stack --patch | |
Python 2.7.3 | |
Testing () patches ... | |
patching file configure.ac | |
patching file gtk/Makefile.am | |
Hunk #1 succeeded at 760 (offset 2 lines). | |
patching file gtk/gtkprivate.h | |
patching file gtk/gtkquartz.c | |
patching file gtk/gtkrelocation.c | |
patching file gtk/gtkfilechooserbutton.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsm_mod = require("lsm") | |
lsm = lsm_mod:new("checking_request_accepts_cache") -- Pass in initial state | |
-- ACTIONS --------------------------------- | |
lsm:action("redis_connect", function() | |
print("#a: Connecting to redis") | |
end) | |
lsm:action("redis_close", function() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local redis = require "redis" | |
local socket = require "socket" | |
local queue = "REVALIDATE" | |
local redis_client = redis.connect("127.0.0.1", 6379) | |
function log(msg) | |
io.stdout:write(os.date('%c', os.time()) .. ' ' .. msg .. "\n") | |
io.stdout:flush() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location /stats { | |
default_type application/json; | |
content_by_lua ' | |
local redis = require "resty.redis" | |
local red = redis:new() | |
local ledge = require "ledge.ledge" | |
local ok, err = red:connect("127.0.0.1", 6379) | |
if not ok then | |
ngx.exit(500) |