Opened 5 years ago
Closed 5 years ago
#60 closed task (fixed)
use rq.job
Reported by: | zhangjr | Owned by: | zhangjr |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | component1 | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Parent ID: | Parent Tickets: | ||
Estimated Number of Hours: | 0.0 | Add Hours to Ticket: | 0 |
Billable?: | yes | Total Hours: | 0 |
Description
myrq.get_queue().enqueue is good way.
Subtickets
Child Tickets
Change History (3)
comment:1 Changed 5 years ago by zhangjr
comment:2 Changed 5 years ago by zhangjr
rq = RQ(app, is_async=True)
rq.connection.flushdb()
rq.job(add)
job1 = add.queue(1, 2)
assert isinstance(job1, import_attribute(rq.job_class))
assert job1.args == (1, 2)
assert job1.kwargs == {}
assert job1.timeout == add.helper.timeout == rq.default_timeout
job2 = add.queue(3, 4, description='job 2')
assert job2.description == 'job 2'
job3_id = uuid.uuid4().hex
job3 = add.queue(5, 6, job_id=job3_id)
assert job3.id == job3_id
job4 = add.queue(7, 8, depends_on=job3)
assert job4.dependency.id == job3.id
comment:3 Changed 5 years ago by zhangjr
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
https://github.com/rq/Flask-RQ2/blob/master/tests/test_jobs.py