feat(billing): cap each owner's stored file volume
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -32,6 +32,15 @@ export class LocalFileStorage implements OnModuleInit {
|
||||
await fs.writeFile(abs, buffer);
|
||||
}
|
||||
|
||||
async sizeOf(storageKey: string): Promise<number> {
|
||||
try {
|
||||
const stat = await fs.stat(this.absolutePath(storageKey));
|
||||
return stat.size;
|
||||
} catch {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
async remove(storageKey: string): Promise<void> {
|
||||
const abs = this.absolutePath(storageKey);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user