@@ -1419,12 +1419,8 @@ func (s *svc) stat(ctx context.Context, req *provider.StatRequest) (*provider.St
1419
1419
return rsp , nil
1420
1420
}
1421
1421
1422
- return s .statAcrossProviders (ctx , req , providers )
1423
- }
1424
-
1425
- func (s * svc ) statAcrossProviders (ctx context.Context , req * provider.StatRequest , providers []* registry.ProviderInfo ) (* provider.StatResponse , error ) {
1426
- // TODO(ishank011): aggregrate properties such as etag, checksum, etc.
1427
- log := appctx .GetLogger (ctx )
1422
+ // otherwise, this is a Stat for "/", which corresponds to a 0-Depth PROPFIND from web to just get the fileid:
1423
+ // we respond with an hardcoded value, no need to poke all storage providers as we did before
1428
1424
info := & provider.ResourceInfo {
1429
1425
Id : & provider.ResourceId {
1430
1426
StorageId : "/" ,
@@ -1437,34 +1433,6 @@ func (s *svc) statAcrossProviders(ctx context.Context, req *provider.StatRequest
1437
1433
Mtime : & types.Timestamp {},
1438
1434
}
1439
1435
1440
- for _ , p := range providers {
1441
- c , err := s .getStorageProviderClient (ctx , p )
1442
- if err != nil {
1443
- log .Err (err ).Msg ("error connecting to storage provider=" + p .Address )
1444
- continue
1445
- }
1446
- resp , err := c .Stat (ctx , req )
1447
- if err != nil {
1448
- log .Err (err ).Msgf ("gateway: error calling Stat %s: %+v" , req .Ref .String (), p )
1449
- continue
1450
- }
1451
- if resp .Status .Code != rpc .Code_CODE_OK {
1452
- log .Err (status .NewErrorFromCode (rpc .Code_CODE_OK , "gateway" )).Send ()
1453
- continue
1454
- }
1455
- if resp .Info != nil {
1456
- info .Size += resp .Info .Size
1457
- if utils .TSToUnixNano (resp .Info .Mtime ) > utils .TSToUnixNano (info .Mtime ) {
1458
- info .Mtime = resp .Info .Mtime
1459
- info .Etag = resp .Info .Etag
1460
- info .Checksum = resp .Info .Checksum
1461
- }
1462
- if info .Etag == "" && info .Etag != resp .Info .Etag {
1463
- info .Etag = resp .Info .Etag
1464
- }
1465
- }
1466
- }
1467
-
1468
1436
return & provider.StatResponse {
1469
1437
Status : status .NewOK (ctx ),
1470
1438
Info : info ,
0 commit comments