mirror of https://github.com/peter4431/rq.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
563 B
Python
17 lines
563 B
Python
import redis
|
|
from rq import use_connection
|
|
|
|
|
|
def add_standard_arguments(parser):
|
|
parser.add_argument('--host', '-H', default='localhost',
|
|
help='The Redis hostname (default: localhost)')
|
|
parser.add_argument('--port', '-p', type=int, default=6379,
|
|
help='The Redis portnumber (default: 6379)')
|
|
parser.add_argument('--db', '-d', type=int, default=0,
|
|
help='The Redis database (default: 0)')
|
|
|
|
|
|
def setup_redis(args):
|
|
redis_conn = redis.Redis(host=args.host, port=args.port, db=args.db)
|
|
use_connection(redis_conn)
|