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

Import reverse from django.urls, not django.core #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Import reverse from django.urls, not django.core #6

wants to merge 1 commit into from

Conversation

Lubo-mir
Copy link

@JACK1SP
Copy link

JACK1SP commented May 28, 2022

@Lubo-mir can you please help me out in this one

I set up everything , my main agenda is schedule the Jobs from django admin
But i am confused at one point

This one is below my rqworker --with-scheduler command which is running on my next side terminal, but this one needs to be runs automatically what i mean here is (when Job Schedule time is came then do the required task, right now when we enforce the python manage.py rqjobs then it will run). I set up a schedule of ONCE with time of Next run of about after 3 minutes
and then I open new terminal and type this command in same directory python manage.py rqjobs nothing provides any output on terminal, and when after 4 minutes of completion as i checked.. Did this Job worked?. No, nothing happens, I checked python manage.py rqworker --with-scheduler no job completed and then i reagain enter python manage.py rqjobs in my next terminal and then job will be started in my worker scheduler terminal and do my required work

How to solve this can you please help. Why worker is not automatically executed?

(myenv) abc@abc-Inspiron-5567:~/python/working/logproj2$ python manage.py rq-worker --with-scheduler
Unknown command: 'rq-worker'. Did you mean rqworker?
Type 'manage.py help' for usage.
(myenv) abc@abc-Inspiron-5567:~/python/working/logproj2$ python manage.py rqworker --with-scheduler
17:47:37 Worker rq:worker:126e69db76954bd9938f3b1074ee606b: started, version 1.10.1
17:47:37 Subscribing to channel rq:pubsub:126e69db76954bd9938f3b1074ee606b
17:47:38 *** Listening on default...
17:47:38 Trying to acquire locks for default
17:47:38 Scheduler for default started with PID 2062
17:51:23 default: modules.testapp.tasks.long_running_func() (df5cde22-8e34-4e26-8d0b-71f00ec68b48)
17:51:23 default: Job OK (df5cde22-8e34-4e26-8d0b-71f00ec68b48)
17:51:23 Result is kept for 500 seconds
18:08:46 default: modules.testapp.tasks.long_running_func() (7aee4450-03da-4fbd-8011-2871137f01c1)
18:08:47 default: Job OK (7aee4450-03da-4fbd-8011-2871137f01c1)
18:08:47 Result is kept for 500 seconds
18:16:15 default: modules.testapp.tasks.long_running_func() (12457fa5-5213-4e67-a6fa-4ab2aaed129c)
18:16:15 default: Job OK (12457fa5-5213-4e67-a6fa-4ab2aaed129c)
18:16:15 Result is kept for 500 seconds


Project settings config

RQ_JOBS_MODULE = 'modules.testapp.tasks'

RQ_QUEUES = {
    'default': {
        'HOST': 'localhost',
        'PORT': 6379,
        'DB': 0,
        'PASSWORD': 1234,
        'DEFAULT_TIMEOUT': 360,
    },
    'with-sentinel': {
        'SENTINELS': [('localhost', 26736), ('localhost', 26737)],
        'MASTER_NAME': 'redismaster',
        'DB': 0,
        'PASSWORD': 'secret',
        'SOCKET_TIMEOUT': None,
        'CONNECTION_KWARGS': {
            'socket_connect_timeout': 0.3
        },
    },
    'high': {
        'URL': os.getenv('REDISTOGO_URL', 'redis://localhost:6379/0'), # If you're on Heroku
        'DEFAULT_TIMEOUT': 500,
    },
    'low': {
        'HOST': 'localhost',
        'PORT': 6379,
        'DB': 0,
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants