forked from TrueCloudLab/frostfs-node
[#902] morph: Avoid creating session in TestInvokeIterator
When the number of items to iterate over is less than 2048, there is no need to create a session and consume resources. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
a2ab373a0a
commit
be8607a1f6
2 changed files with 44 additions and 11 deletions
|
@ -41,7 +41,7 @@ func (c *Client) ContainersOf(idUser *user.ID) ([]cid.ID, error) {
|
|||
}
|
||||
|
||||
cnrHash := c.client.ContractAddress()
|
||||
err := c.client.Morph().TestInvokeIterator(cb, cnrHash, containersOfMethod, rawID)
|
||||
err := c.client.Morph().TestInvokeIterator(cb, 0, cnrHash, containersOfMethod, rawID)
|
||||
if err != nil {
|
||||
if errors.Is(err, unwrap.ErrNoSessionID) {
|
||||
return c.List(idUser)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue