This commit is contained in:
syuilo
2018-07-21 19:17:15 +09:00
parent 049085fb7a
commit 297a7f541e
9 changed files with 17 additions and 13 deletions

View File

@@ -17,6 +17,7 @@ import { isLocalUser, IUser, IRemoteUser } from '../../models/user';
import { getDriveFileThumbnailBucket } from '../../models/drive-file-thumbnail';
import genThumbnail from '../../drive/gen-thumbnail';
import delFile from './delete-file';
import config from '../../config';
const gm = _gm.subClass({
imageMagick: true
@@ -175,8 +176,10 @@ export default async function(
log(`drive usage is ${usage}`);
const driveCapacity = 1024 * 1024 * (isLocalUser(user) ? config.localDriveCapacityMb : config.remoteDriveCapacityMb);
// If usage limit exceeded
if (usage + size > user.driveCapacity) {
if (usage + size > driveCapacity) {
if (isLocalUser(user)) {
throw 'no-free-space';
} else {