diff options
| author | Gauvain Pocentek <gauvain@pocentek.net> | 2016-07-17 14:09:39 +0200 |
|---|---|---|
| committer | Gauvain Pocentek <gauvain@pocentek.net> | 2016-07-17 14:09:39 +0200 |
| commit | 94aea524a23ac428259bae327a1fccdd2f5b841d (patch) | |
| tree | f8c3c8a90f4baf8ef271f6df3572de7991bbe22c /docs/gl_objects/builds.rst | |
| parent | 8e6a9442324926ed1dec0a8bfaf77792e4bdb10f (diff) | |
| download | gitlab-94aea524a23ac428259bae327a1fccdd2f5b841d.tar.gz | |
Allow to stream the downloads when appropriate
Some API calls will download possibly large data, resulting in a high
memory usage and out-of-memory errors. For these API calls use the
requests streaming capabilities and download chunked data. The caller is
responsible of providing a callable to actually store the data.
The default callable just prints the data on stdout.
Diffstat (limited to 'docs/gl_objects/builds.rst')
| -rw-r--r-- | docs/gl_objects/builds.rst | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/docs/gl_objects/builds.rst b/docs/gl_objects/builds.rst index 23f47f0..ce4cc0e 100644 --- a/docs/gl_objects/builds.rst +++ b/docs/gl_objects/builds.rst @@ -116,7 +116,16 @@ Get a build artifacts: .. warning:: - Artifacts are entirely stored in memory. + Artifacts are entirely stored in memory in this example. + +.. _streaming_example: + +You can download artifacts as a stream. Provide a callable to handle the +stream: + +.. literalinclude:: builds.py + :start-after: # stream artifacts + :end-before: # end stream artifacts Mark a build artifact as kept when expiration is set: @@ -132,7 +141,8 @@ Get a build trace: .. warning:: - Traces are entirely stored in memory. + Traces are entirely stored in memory unless you use the streaming feature. + See :ref:`the artifacts example <streaming_example>`. Cancel/retry a build: |
