1
- import warnings
2
-
3
1
from . import base
4
2
5
3
6
4
class Section (base .SectionBase ):
7
5
@base .returns_multiple_items (base .ResponseBase )
8
- def gc (self , * , quiet : bool = False , return_result : bool = True , ** kwargs : base .CommonArgs ):
6
+ def gc (self , * , quiet : bool = False , ** kwargs : base .CommonArgs ):
9
7
"""Removes stored objects that are not pinned from the repo
10
8
11
9
.. code-block:: python
@@ -30,27 +28,13 @@ def gc(self, *, quiet: bool = False, return_result: bool = True, **kwargs: base.
30
28
Passing ``True`` to this parameter often causing the GC process to
31
29
speed up tremendously as it will also avoid generating the list of
32
30
removed objects in the connected daemon at all.
33
- return_result
34
- If ``False`` this is a legacy alias for ``quiet=True``.
35
-
36
- (Will be dropped in py-ipfs-api-client 0.7.x!)
37
31
38
32
Returns
39
33
-------
40
34
dict
41
35
List of IPFS objects that have been removed
42
36
"""
43
- if not return_result :
44
- warnings .warn ("Parameter `return_result` of `.repo.gc(…)` is deprecated "
45
- "in favour of the newer `quiet` parameter" , DeprecationWarning )
46
-
47
- quiet = quiet or not return_result
48
-
49
- if "use_http_head_for_no_result" not in self ._client .workarounds :
50
- # go-ipfs 0.4.22- does not support the quiet option yet
51
- kwargs .setdefault ("opts" , {})["quiet" ] = quiet
52
-
53
- kwargs .setdefault ("return_result" , not quiet )
37
+ kwargs .setdefault ("opts" , {})["quiet" ] = quiet
54
38
55
39
return self ._client .request ('/repo/gc' , decoder = 'json' , ** kwargs )
56
40
0 commit comments