File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ def pyres_web():
7474 parser .add_option ("--dsn" ,
7575 dest = "dsn" ,
7676 help = "Redis server to display" )
77+ parser .add_option ("--auth" ,
78+ dest = "auth" ,
79+ help = "Redis user:pass" )
7780 parser .add_option ("--server" ,
7881 dest = "server" ,
7982 help = "Server for itty to run under." ,
@@ -82,7 +85,14 @@ def pyres_web():
8285
8386 if options .dsn :
8487 from pyres import ResQ
85- resweb_server .HOST = ResQ (options .dsn )
88+ if options .auth is not None :
89+ from redis import Redis
90+ rhost , rport = options .dsn .split (':' )
91+ ruser , rpass = options .auth .split (':' )
92+ redis = Redis (host = rhost , port = int (rport ), db = ruser , password = rpass )
93+ resweb_server .HOST = ResQ (redis )
94+ else :
95+ resweb_server .HOST = ResQ (options .dsn )
8696 run_itty (host = options .host , port = options .port , server = options .server )
8797
8898
You can’t perform that action at this time.
0 commit comments