mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-06 20:16:57 +00:00
enforce maxFileSize for remote users
This commit is contained in:
parent
805ec98ec0
commit
54b5c930cb
1 changed files with 6 additions and 1 deletions
|
@ -522,11 +522,16 @@ export class DriveService {
|
|||
if (maxFileSize < info.size) {
|
||||
if (isLocalUser) {
|
||||
throw new IdentifiableError('f9e4e5f3-4df4-40b5-b400-f236945f7073', 'Max file size exceeded.');
|
||||
} else {
|
||||
// For remote users, throwing an exception will break Activity processing.
|
||||
// Instead, force "link" mode which does not cache the file locally.
|
||||
isLink = true;
|
||||
}
|
||||
}
|
||||
|
||||
// If usage limit exceeded
|
||||
if (driveCapacity < usage + info.size) {
|
||||
// Repeat the "!isLink" check because it could be set to true by the previous block.
|
||||
if (driveCapacity < usage + info.size && !isLink) {
|
||||
if (isLocalUser) {
|
||||
throw new IdentifiableError('c6244ed2-a39a-4e1c-bf93-f0fbd7764fa6', 'No free space.', true);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue