@ckan.logic.validate(ckan.logic.schema.job_clear_schema)
def job_clear(context, data_dict):
 _check_access(u'job_clear', context, data_dict)
 queues = data_dict.get(u'queues')
 if queues:
  queues = [jobs.get_queue(q) for q in queues]
 else:
  queues = jobs.get_all_queues()
 names = [jobs.remove_queue_name_prefix(queue.name) for queue in queues]
 for (queue, name) in zip(queues, names):
  queue.empty()
  log.info(u'Cleared background job queue "{}"'.format(name))
 return names

@ ckan . logic . validate ( ckan . logic . schema . job_clear_schema ) def job_clear ( context , data_dict ) : _check_access ( u'job_clear' , context , data_dict ) queues = data_dict . get ( u'queues' ) if queues : queues = [ jobs . get_queue ( q ) for q in queues ] else : queues = jobs . get_all_queues ( ) names = [ jobs . remove_queue_name_prefix ( queue . name ) for queue in queues ] for ( queue , name ) in zip ( queues , names ) : queue . empty ( ) log . info ( u'Cleared background job queue "{}"' . format ( name ) ) return names
clear background jobs .