[katello-devel] async jobs are in master
Dmitri Dolguikh
dmitri at redhat.com
Fri Jul 8 17:54:37 UTC 2011
You can now create async jobs and track their status. You will need to
execute db migrations after you pull in the changes.
Before creating an async job make sure that you included
AsyncOrchestration module into the model class in question. After that,
to start an async job:
System.async(:organization_id =>
@environment.organization.id).create!(params.merge({:environment =>
@environment})), or
@system.async(:organization_id =>
@environment.organization.id).regenerate_identity_certificates
please note that you have to pass in organization_id in async call atm.
The idea was to associate async jobs with organizations (for both
security and convenience sake), not sure if it's useful. To start async
jobs processing, you will need to run:
rake jobs:work
To clear jobs queue, run:
rake jobs:clear
You can list all pending/running jobs in an organization:
curl -k -u admin:admin
https://localhost:3000/api/organizations/ACME_Corporation/tasks
Or, you can get the status of a particular job (note the use of uuid for
job id):
curl -k -u admin:admin
https://localhost:3000/api/tasks/fe79f0d3-bb4b-4ed7-8c5e-6bebcdace0a0
Please also note that successfully completed jobs will be removed from
the queue, while failed one will be left in the queue.
Please let me know if you have any questions/comments/suggestions,
-d
More information about the katello-devel
mailing list