mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-31 01:10:20 -06:00
use key to get specific trash item
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
Bugfix: Use key to get specific trash item
|
||||
|
||||
The activitylog and clientlog services now only fetch the specific trash item instead of getting all items in trash and filtering them on their side. This reduces the load on the storage users service because it no longer has to assemble a full trash listing.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9879
|
||||
@@ -99,6 +99,7 @@ func WithTrashedResource(ref *provider.Reference, rid *provider.ResourceId) Acti
|
||||
|
||||
resp, err := gwc.ListRecycle(ctx, &provider.ListRecycleRequest{
|
||||
Ref: ref,
|
||||
Key: rid.GetOpaqueId(),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -221,6 +221,7 @@ func processShareEvent(ctx context.Context, ref *provider.Reference, gwc gateway
|
||||
func processItemTrashedEvent(ctx context.Context, ref *provider.Reference, gwc gateway.GatewayAPIClient, initiatorid string, itemID *provider.ResourceId) ([]string, FileEvent, error) {
|
||||
resp, err := gwc.ListRecycle(ctx, &provider.ListRecycleRequest{
|
||||
Ref: ref,
|
||||
Key: itemID.GetOpaqueId(),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, FileEvent{}, err
|
||||
|
||||
@@ -345,7 +345,7 @@ func restoreTrashBindItem(cfg *config.Config) *cli.Command {
|
||||
|
||||
func listRecycle(ctx context.Context, client gateway.GatewayAPIClient, ref provider.Reference) (*provider.ListRecycleResponse, error) {
|
||||
_retrievingErrorMsg := "trash-bin items retrieving error"
|
||||
res, err := client.ListRecycle(ctx, &provider.ListRecycleRequest{Ref: &ref, Key: "/"})
|
||||
res, err := client.ListRecycle(ctx, &provider.ListRecycleRequest{Ref: &ref, Key: ""})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%s %w", _retrievingErrorMsg, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user