Print current size not just limit
This commit is contained in:
parent
e83539bb48
commit
62427183fd
1 changed files with 19 additions and 16 deletions
|
|
@ -369,22 +369,25 @@ export class UnrestrictedSyncer {
|
||||||
this.logger.debug(`Syncing ${relativePath} (${syncType})`);
|
this.logger.debug(`Syncing ${relativePath} (${syncType})`);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (
|
if (await this.operations.exists(relativePath)) {
|
||||||
(await this.operations.exists(relativePath)) &&
|
const sizeInMB = Math.round(
|
||||||
(await this.operations.getFileSize(relativePath)) / // this can throw FileNotFoundError
|
(await this.operations.getFileSize(relativePath)) /
|
||||||
1024 /
|
1024 /
|
||||||
1024 >
|
1024
|
||||||
this.settings.getSettings().maxFileSizeMB
|
);
|
||||||
) {
|
|
||||||
this.history.addHistoryEntry({
|
if (sizeInMB > this.settings.getSettings().maxFileSizeMB) {
|
||||||
status: SyncStatus.ERROR,
|
this.history.addHistoryEntry({
|
||||||
relativePath,
|
status: SyncStatus.ERROR,
|
||||||
message: `File size exceeds the maximum file size limit of ${
|
relativePath,
|
||||||
this.settings.getSettings().maxFileSizeMB
|
message: `File size of ${sizeInMB} MB exceeds the maximum file size limit of ${
|
||||||
}MB`,
|
this.settings.getSettings().maxFileSizeMB
|
||||||
type: syncType
|
} MB`,
|
||||||
});
|
type: syncType
|
||||||
return;
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return await fn();
|
return await fn();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue