Coder Social home page Coder Social logo

django-db-queue's People

Contributors

angrylawyer avatar collinr3 avatar dependabot[bot] avatar j4mie avatar james-certn avatar johncmacy avatar jordaneb avatar maximilianhurl avatar nkantar avatar nvlaarhoven avatar realorangeone avatar timstimpson avatar weargoggles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-db-queue's Issues

Add user field to Job model

Would you consider adding a nullable ForeignKey field to store the user that a job belongs to?

class Job(models.Model):
    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, null=True, related_name='jobs')
    ...

It would then be possible to assign users to jobs within views that create them, or from any other context in which the user is known:

def my_view(request):
    job = Job.objects.create(name='my_job', user=request.user)
    ...

I realize I can subclass Job and add it myself:

class JobWithUser(Job):
    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='jobs')

However, it would be more convenient for anyone who wants this functionality if it were available out-of-the-box.

Running manage.py worker in a Cpanel shared env

Hi,

Firstly, thank you for sharing this app - I heard Jamie mention it on DjangoChat a while back.

I'm now looking to use it and I wonder if you can help me.

I have my django app running in a shared env (Hostpresto) under Phusion passenger and I want to add 'django-db-queue' to manage periodic tasks. The hosting team suggest setting up a cron job to to run. manage.py worker periodically.

Q1: Do you have any experience of deploying this app into a cpanel /shared env, if so how did you make it work?

Q2: In your opinion, is using cron to run manage.py worker a reasonable approach.

Thoughts?

Rob

Django model utils > 2.3.1

Can django model utils version be greater than 2.3.1 without breaking anything ? In the application I am developing I have a strict requirement for django model utils at least 3.x.x

Job bulk_create

Current Job creation depends on .save() to be called, as a result processing jobs created using bulk_create causes django-level exceptions.

Either the Query manager should be overridden to return UnsupportedOperation or the code refactored to work with bulk_create

stdout on worker start incorrectly describes the rate limit as rate per second

As is
self.stdout.write( 'Starting job worker for queue "%s" with rate limit %s/s' % (queue_name, rate_limit_in_seconds) )
proposed
``self.stdout.write(
'Starting job worker for queue "%s" with rate limit of one job per %s second(s)'
% (queue_name, rate_limit_in_seconds)
)
`

If you're ok with the wording, I'm happy to submit a Pull request to correct this.

non-persistent Worker

Would be great if there was a possibility to launch a Worker process that terminates when no more jobs are available so that a worker can be launched from a Cron or scheduler periodically

something like "--non-persistent" command line option

Readme out of date?

The readme says jobs should be in the format

{
    'my_job': ['project.common.jobs.my_task'],
}

But the code (1.2) errors out unless it's in the format...

{
    'my_job': {
        'tasks': ['project.common.jobs.my_task'],
    }
}

Can't install from PyPI

Haven't investigated this at all yet, but..

$ env/bin/pip install django-db-queue
Downloading/unpacking django-db-queue
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement django-db-queue
Cleaning up...
No distributions at all found for django-db-queue
Storing debug log for failure in /Users/jamie/.pip/pip.log

cc @weargoggles

Simple django-admin UI

Nice library, thanks for all the work! Would be useful to have a GUI view of Jobs showing which ones are queued up to run and when, and which ones have been run.

create_job command : args queue_name and workspace don't work

Failing to run create_job command with either --queue_name or --workspace args :

python manage.py create_job test_web_api --queue_name not_default

manage.py create_job: error: unrecognized arguments: not_default
python manage.py create_job test_web_api --worskpace '{"key": "value"}'

manage.py create_job: error: unrecognized arguments: --worskpace {"key": "value"}

I think it may work by changing the action parameter for argparse from store_true to store :

# create_job.py Command.add_arguments()
    def add_arguments(self, parser):
        parser.add_argument("args", nargs="+")
        parser.add_argument(
            "--workspace",
            action="store", # is currently "store_true"
            dest="workspace",
            default=None,
            help="JSON-formatted initial commandworkspace.",
        )
        parser.add_argument(
            "--queue_name",
            action="store", # is currently "store_true"
            dest="queue_name",
            default=None,
            help="A specific queue to add this job to",
        )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.