From caf8d2a055c1a115525fad37f01e0f4a534d55c8 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Wed, 13 Nov 2024 21:14:56 -0500 Subject: [PATCH] dev: track ll_readshares depth --- .../src/filesystem/ll_operations/ll_readshares.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/backend/src/filesystem/ll_operations/ll_readshares.js b/src/backend/src/filesystem/ll_operations/ll_readshares.js index e8132154..a27e31d5 100644 --- a/src/backend/src/filesystem/ll_operations/ll_readshares.js +++ b/src/backend/src/filesystem/ll_operations/ll_readshares.js @@ -33,12 +33,13 @@ class LLReadShares extends LLFilesystemOperation { async _run () { const results = []; - await this.recursive_part(results, this.values); + const stats = await this.recursive_part(results, this.values); + // console.log('LL_READ_SHARES_STATS !!!!!', stats); return results; } - async recursive_part (results, { subject, user, actor }) { + async recursive_part (results, { subject, user, actor, depth = 0 }) { actor = actor || Context.get('actor'); const ll_readdir = new LLReadDir(); const children = await ll_readdir.run({ @@ -73,11 +74,15 @@ class LLReadShares extends LLFilesystemOperation { } const p = this.recursive_part(results, { - subject: child, user }); + subject: child, + user, + depth: depth + 1, + }); promises.push(p); } - await Promise.all(promises); + const stats = await Promise.all(promises); + return Math.max(depth, ...stats); } }