Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rqscheduler.py #301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update rqscheduler.py
Your description is a good start, but we can improve it for clarity and completeness. Here's a revised version:

"I addressed the issue of redis.exceptions.ConnectionError occurring when launching the rq-scheduler CLI. The problem was resolved by ensuring that the necessary arguments from the terminal are appropriately passed to the redis connection function, preventing the ConnectionError and ensuring smooth execution of the rq-scheduler CLI."
Simeon2001 authored Oct 16, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 3631996535653f14242d2b2024a2e158d0a55a17
5 changes: 3 additions & 2 deletions rq_scheduler/scripts/rqscheduler.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import sys
import os

from redis import Redis
import redis
from rq_scheduler.scheduler import Scheduler

from rq_scheduler.utils import setup_loghandlers
@@ -19,6 +19,7 @@ def main():
parser.add_argument('-P', '--password', default=os.environ.get('RQ_REDIS_PASSWORD'), help="Redis password")
parser.add_argument('--verbose', '-v', action='store_true', default=False, help='Show more output')
parser.add_argument('--quiet', action='store_true', default=False, help='Show less output')
parser.add_argument('-s', '--ssl', default=False, type=bool, help='to use ssl connection')
parser.add_argument('--url', '-u', default=os.environ.get('RQ_REDIS_URL')
, help='URL describing Redis connection details. \
Overrides other connection arguments if supplied.')
@@ -44,7 +45,7 @@ def main():
if args.url is not None:
connection = Redis.from_url(args.url)
else:
connection = Redis(args.host, args.port, args.db, args.password)
connection = redis.Redis(host=args.host, port=args.port, db=args.db, password=args.password, ssl=False)

if args.verbose:
level = 'DEBUG'