Default to 1000. Note that beanstalk priority is 2^31, so this
won't mix well with older code scheduling things at the
beanstalk default priority.
Signed-off-by: Sage Weil <sage@inktank.com>
type=int,
help='number of times to run/queue the job'
)
+ parser.add_argument(
+ '-p', '--priority',
+ default=1000,
+ type=int,
+ help='beanstalk priority (lower is sooner)'
+ )
parser.add_argument(
'-v', '--verbose',
action='store_true',
job = yaml.safe_dump(job_config)
num = ctx.num
while num > 0:
- jid = beanstalk.put(job, ttr=60*60*24)
+ jid = beanstalk.put(
+ job,
+ ttr=60*60*24,
+ priority=ctx.priority,
+ )
print 'Job scheduled with ID {jid}'.format(jid=jid)
num -= 1