Skip to content

Commit caf8d2a

Browse files
committed
dev: track ll_readshares depth
1 parent 249dc06 commit caf8d2a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/backend/src/filesystem/ll_operations/ll_readshares.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ class LLReadShares extends LLFilesystemOperation {
3333

3434
async _run () {
3535
const results = [];
36-
await this.recursive_part(results, this.values);
36+
const stats = await this.recursive_part(results, this.values);
37+
// console.log('LL_READ_SHARES_STATS !!!!!', stats);
3738

3839
return results;
3940
}
4041

41-
async recursive_part (results, { subject, user, actor }) {
42+
async recursive_part (results, { subject, user, actor, depth = 0 }) {
4243
actor = actor || Context.get('actor');
4344
const ll_readdir = new LLReadDir();
4445
const children = await ll_readdir.run({
@@ -73,11 +74,15 @@ class LLReadShares extends LLFilesystemOperation {
7374
}
7475

7576
const p = this.recursive_part(results, {
76-
subject: child, user });
77+
subject: child,
78+
user,
79+
depth: depth + 1,
80+
});
7781
promises.push(p);
7882
}
7983

80-
await Promise.all(promises);
84+
const stats = await Promise.all(promises);
85+
return Math.max(depth, ...stats);
8186
}
8287
}
8388

0 commit comments

Comments
 (0)