b5a8b7035e
On our Jenkins instance with almost a hundred folders, JJB update stalls for quite a while because it calls get_all_jobs. When invoked locally at the Jenkins master, it's a matter of seconds, on a fast broadband link and VPN, it's 2 minutes, and on a train it's easily 10 minutes. But there's trick! curl \ --show-error --silent --fail \ --user : --negotiate \ --get \ --data-urlencode \ tree=jobs\[url\,name\,jobs\[url\,name\,jobs\[url\,name\,\ jobs\[url\,name\,jobs\[url\,name\,jobs\[url\,name\,\ jobs\[url\,name\,jobs\[url\,name\,jobs\[url\,name\,\ jobs\[url\,name\,jobs\]\]\]\]\]\]\]\]\]\] https://jenkins.example.com/api/json This returns almost instantly. And it gets better: if we fail to correctly guess the nesting level necessary, Jenkins returns …, "jobs": [{}, {}, …], … so we can easily detect that we need to recurse deeper. Change-Id: I7268259149e4bc8939c512a112c7e6ec1908224f |
||
---|---|---|
.. | ||
jobs | ||
__init__.py | ||
base.py | ||
helper.py | ||
test_build.py | ||
test_credential.py | ||
test_info.py | ||
test_jenkins_sockets.py | ||
test_jenkins.py | ||
test_job_folder.py | ||
test_node.py | ||
test_plugins.py | ||
test_promotion.py | ||
test_queue.py | ||
test_quiet_down.py | ||
test_rest_endpoints.py | ||
test_script.py | ||
test_version.py | ||
test_view.py | ||
test_whoami.py |