Skip to content

Commit 2cc260c

Browse files
committed
Improve documentation somewhat
1 parent fe9581c commit 2cc260c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

lib/utils.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,20 +288,28 @@ async function getQuota (root, serverUri) {
288288
return quota
289289
}
290290

291+
/**
292+
* Returns true of the user has exceeded their quota
293+
*/
294+
291295
async function overQuota (root, serverUri) {
292296
let quota = await getQuota(root, serverUri)
293297
if (quota === Infinity) {
294298
return false
295299
}
296-
// IMPORTANT NOTE: The following will traverse the directory to find
297-
// the actual file size of the files in the file system. This is a
298-
// costly operation, but neglible for the small quotas we currently
299-
// allow. If the quotas grow bigger, this will significantly reduce
300-
// write performance, and so it needs to be rewritten.
301300
var size = await actualSize(root)
302301
return (size > quota)
303302
}
304303

304+
/**
305+
* Returns the number of bytes that is occupied by the actual files in
306+
* the file system. IMPORTANT NOTE: Since it traverses the directory
307+
* to find the actual file sizes, this does a costly operation, but
308+
* neglible for the small quotas we currently allow. If the quotas
309+
* grow bigger, this will significantly reduce write performance, and
310+
* so it needs to be rewritten.
311+
*/
312+
305313
function actualSize (root) {
306314
return util.promisify(getSize)(root)
307315
}

0 commit comments

Comments
 (0)